Get the Status

Hi everyone,
The solution for this might be simple but my brain is just too tired :(
I have this example table....
create table tmp_data(
tmp_data_id number,
tmp_data_date date,
tmp_data_id_request number,
tmp_data_status varchar2(50) );I have this example inserts....
insert into tmp_data values(1,SYSDATE, 100, 'INITIALIZED');
insert into tmp_data values(2,SYSDATE+1,100, 'PENDING APPROVAL');
insert into tmp_data values(3,SYSDATE+2, 100, 'APPROVED');
insert into tmp_data values(4,SYSDATE+3, 100, 'CONCLUDED');
insert into tmp_data values(5,SYSDATE, 101, 'INITIALIZED');The request is to show the data like this:
COL1...col2...............col3
100...INITIALIZED...10/04/2012
100...Changed from INITIALIZED->PENDING APPROVAL...10/04/2012
100..Changed from PENDING APPROVAL -> APPROVED...11/04/2012
100..Changed from APPROVED -> CONCLUDED...11/04/2012
101...INITIALIZED...10/04/2012P.S Oracle DB 11g

Try looking at using the LAG function...
e.g.
SQL> ed
Wrote file afiedt.buf
  1  select deptno, empno, ename, job, lag(job) over (partition by deptno order by empno) as prev_emps_job
  2  from emp
  3* order by deptno, empno
SQL> /
    DEPTNO      EMPNO ENAME      JOB       PREV_EMPS
        10       7782 CLARK      MANAGER
        10       7839 KING       PRESIDENT MANAGER
        10       7934 MILLER     CLERK     PRESIDENT
        20       7369 SMITH      CLERK
        20       7566 JONES      MANAGER   CLERK
        20       7788 SCOTT      ANALYST   MANAGER
        20       7876 ADAMS      CLERK     ANALYST
        20       7902 FORD       ANALYST   CLERK
        30       7499 ALLEN      SALESMAN
        30       7521 WARD       SALESMAN  SALESMAN
        30       7654 MARTIN     SALESMAN  SALESMAN
        30       7698 BLAKE      MANAGER   SALESMAN
        30       7844 TURNER     SALESMAN  MANAGER
        30       7900 JAMES      CLERK     SALESMANHave a go and see if you can work it out from that.
Edit: or alternatively people can just give you the answer so you don't learn for yourself. :/
Edited by: BluShadow on 10-Apr-2012 15:49

Similar Messages

  • How to get the status of a window?

    Is there a way to get the status of a display window? I'm looking specifically for whether or not it is open and what image is being displayed in it.
    If there is no easy way to do this, can it be added to the list of suggestions for the next version?

    Right now there is no way to determine these attributes from software. When I went to enter a suggestion to R&D, I found that a very similar one was submitted recently. I added your suggestions to the current one. I'm sorry there isn't an easy solution.
    Kyle V.

  • How do I get the status bar to appear in FF4.1?

    I upgraded to FF4.1 and discovered the status bar had disappeared and a few add-ons no longer worked :/
    After discovering this I re-installed FF3.
    How can I get the status bar back?
    TYIA
    Max

    See step #10 installing the Status-4-Evar extension in the following ...
    You can make Firefox 4.0.1 look like Firefox 3.6.17, see numbered items 1-10 in the following topic [http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface Fix Firefox 4.0 toolbar user interface, problems (Make Firefox 4.0 look like 3.6)]

  • Which table i will  get the  status of the User decision Result status

    Hi Experts
    Which table i will  get the  status of the User decision Result status
    (eg : Inspection completion forced )
    This i can see in QA33

    Hi jag
    Ok fine actually it is not storing in any table...these r all text symols...if u see this program MQEVAF22...U EILL GET SOME IDEA
    CALL FUNCTION 'QAST_STATUS_CHECK'
           EXPORTING
                I_OBJNR          = QALS-OBJNR
                I_STATUS         = C_STATUS_PAKO
           EXCEPTIONS
                STATUS_NOT_ACTIV = 01.
      IF SY-SUBRC NE C_RC01.
        MOVE C_KREUZ TO L_STAT_PAKO.
      ELSE.
        CLEAR L_STAT_PAKO.
      ENDIF.
    Prüfen, ob Los bestandsrelevant ist
      MOVE RQEVA-STAT_BERF TO L_STAT_BERF.
    Prüfen, ob Los auf SKIP sitzt
      CALL FUNCTION 'QAST_STATUS_CHECK'
           EXPORTING
                I_OBJNR          = QALS-OBJNR
                I_STATUS         = C_STATUS_SKIP
           EXCEPTIONS
                STATUS_NOT_ACTIV = 01.
      IF SY-SUBRC NE C_RC01.
        MOVE C_KREUZ TO L_STAT_SKIP.
      ELSE.
        CLEAR L_STAT_SKIP.
      ENDIF.
      IF QALS-STAT35 >< C_KREUZ.
    VE noch nicht getroffen !
        IF     ( QALS-OFFENNLZMK > CI_0 OR QALS-OFFEN_LZMK > CI_0 )
           AND QALS-STAT13     = C_PPKTTYP-PHPR
           AND G_ANZAHL_PPKT_LOEVM > CI_0.
    Es wurden physische Proben storniert !              PRIORITÄT 1A
            MOVE TEXT-I17 TO RQEVA-INFO_LINE.  L_TEXT_NR = 'I17'.
        ELSEIF ( QALS-STAT14 = C_KREUZ AND QALS-OFFENNLZMK > CI_0 )
          OR ( L_STAT_PAKO = C_KREUZ
               AND ( QALS-OFFENNLZMK > CI_0 OR QALS-OFFEN_LZMK > CI_0 ) ).
    Prüfung wurde abgebrochen !                         PRIORITÄT 1
          MOVE TEXT-I04 TO RQEVA-INFO_LINE.    L_TEXT_NR = 'I04'.
          MOVE C_KREUZ TO L_ICON.
        ELSEIF G_ANZ_RUECK_MK > 0.
    Es wurden Merkmale rückgewiesen  !                  PRIORITÄT 2
          MOVE TEXT-I01 TO RQEVA-INFO_LINE.    L_TEXT_NR = 'I01'.
          MOVE C_KREUZ TO L_ICON.
        ELSEIF QALS-OFFENNLZMK > CI_0 OR QALS-OFFEN_LZMK > CI_0 .
          IF QALS-OFFENNLZMK > CI_0.
    Es sind nicht alle Merkmale abgeschlossen !         PRIORITÄT 3
            MOVE TEXT-I02 TO RQEVA-INFO_LINE.  L_TEXT_NR = 'I02'.
          ELSEIF QALS-OFFEN_LZMK > CI_0.
            MOVE TEXT-I05 TO RQEVA-INFO_LINE.  L_TEXT_NR = 'I05'.
          ENDIF.
        ELSEIF QALS-WERK NE QALS-WERKVORG.
        Prüflosmenge wurde umgelagert auf anderes Werk   Priorität 4
          MOVE TEXT-I16 TO RQEVA-INFO_LINE.    L_TEXT_NR = 'I16'.
        ELSEIF QALS-LMENGEIST > QALS-LOSMENGE.
        Istmenge im Los größer als Losmenge!             Priorität 5
          MOVE TEXT-I15 TO RQEVA-INFO_LINE.    L_TEXT_NR = 'I15'.
        ELSEIF L_STAT_SKIP    = C_KREUZ.
    Prüfverzicht: Los ist geskippt !                    PRIORITÄT 6
          MOVE TEXT-I03 TO RQEVA-INFO_LINE.    L_TEXT_NR = 'I03'.
        ENDIF.
      ELSE.
    VE getroffen bzw. eingetragen
       IF     ( QALS-OFFENNLZMK > CI_0 OR QALS-OFFEN_LZMK > CI_0 )
           AND QALS-STAT13     = C_PPKTTYP-PHPR
           AND G_ANZAHL_PPKT_LOEVM > CI_0.
    Es wurden physische Proben storniert !              PRIORITÄT 1A
            MOVE TEXT-I17 TO RQEVA-INFO_LINE.  L_TEXT_NR = 'I17'.
        ELSEIF ( QALS-STAT14 = C_KREUZ AND QALS-OFFENNLZMK > CI_0 )
          OR ( L_STAT_PAKO = C_KREUZ
              AND ( QALS-OFFENNLZMK > CI_0  OR QALS-OFFEN_LZMK > CI_0 ) ).
    Prüfung wurde abgebrochen !                         PRIORITÄT 1
          MOVE TEXT-I04 TO RQEVA-INFO_LINE.    L_TEXT_NR = 'I04'.
          MOVE C_KREUZ TO L_ICON.
        ELSEIF L_STAT_PAKO EQ SPACE
           AND ( QALS-OFFENNLZMK > CI_0 OR QALS-OFFEN_LZMK > CI_0 ).
    Es sind noch Langzeitmerkmale zu bearbeiten !       PRIORITÄT 2
          MOVE TEXT-I05 TO RQEVA-INFO_LINE.    L_TEXT_NR = 'I05'.
        ELSEIF L_STAT_BERF = C_KREUZ AND QALS-STAT34 EQ SPACE.
    Los ist bestandsmäßig noch nicht entlastet !        PRIORITÄT 3
          MOVE TEXT-I06 TO RQEVA-INFO_LINE.    L_TEXT_NR = 'I06'.
        ELSEIF QALS-WERK NE QALS-WERKVORG.
        Prüflosmenge wurde umgelagert auf anderes Werk   Priorität 4
          MOVE TEXT-I16 TO RQEVA-INFO_LINE.    L_TEXT_NR = 'I16'.
        ELSEIF QALS-LMENGEIST > QALS-LOSMENGE.
        Istmenge im Los größer als Losmenge!             Priorität 5
          MOVE TEXT-I15 TO RQEVA-INFO_LINE.    L_TEXT_NR = 'I15'.
        ELSEIF L_STAT_SKIP = C_KREUZ.
    Prüfverzicht: Los ist geskippt !                    PRIORITÄT 6
          MOVE TEXT-I03 TO RQEVA-INFO_LINE.    L_TEXT_NR = 'I03'.
        ENDIF.
      ENDIF.

  • From which table can we get the status of sales order

    hi
    from which table can we get the status of sales order

    Hi
    Check the Table <b>VBUK for HEADER level status</b> of Sales order
    and <b>VBUP for Item level statuses</b>
    enter VBELN  = Sales order and VBTYP = C for sales orders
    as VBUK and VBUP stores all Sales documents like deliveries, Invoices, quotations, contracts etc
    <b>Reward points for useful Answers</b>
    Regards
    Anji
    Message was edited by:
            Anji Reddy Vangala

  • Unknown error: there was a problem getting the status directory!

    Hi, Folks,
    I followed the instructions on this page :http://deimos.apple.com/rsrc/doc/iTunesUAdministrationGuide/AddingContent/chapte r_12_section_6.html#//apple_ref/doc/uid/AdminGuide-CH22-SW5, and try to upload a file to our university's Itunes U site.
    I believe got every step right, but server return a error message: "unknown error: there was a problem getting the status directory". Any suggestion or information will be helpful.
    Thanks
    Youjun

    Forgot to mention.  ours is a public site but the collection I am trying to access is not published.
    Youjun

  • How to get the status of service in rac

    Dear all,
    how to get the status of service in rac.
    SQL> show parameters service;
    NAME                                 TYPE        VALUE
    service_names                        string      DEVDB, DEVDB1, devdb
    [oracle@rac1 ~]$ srvctl status service -d devdb -s devdb
    PRKO-2120 : The internal database service devdb cannot be managed with srvctl.

    user7244870 wrote:
    Dear all,
    how to get the status of service in rac.
    SQL> show parameters service;
    NAME                                 TYPE        VALUE
    service_names                        string      DEVDB, DEVDB1, devdb
    [oracle@rac1 ~]$ srvctl status service -d devdb -s devdb
    PRKO-2120 : The internal database service devdb cannot be managed with srvctl.
    Internal services cannot be managed with srvctl utility. Check if you have any user defined service in dba_services
    SQL> desc dba_services
    Name                                      Null?    Type
    SERVICE_ID                                         NUMBER
    NAME                                               VARCHAR2(64)
    NAME_HASH                                          NUMBER
    NETWORK_NAME                                       VARCHAR2(512)
    CREATION_DATE                                      DATE
    CREATION_DATE_HASH                                 NUMBER
    FAILOVER_METHOD                                    VARCHAR2(64)
    FAILOVER_TYPE                                      VARCHAR2(64)
    FAILOVER_RETRIES                                   NUMBER(10)
    FAILOVER_DELAY                                     NUMBER(10)
    MIN_CARDINALITY                                    NUMBER
    MAX_CARDINALITY                                    NUMBER
    GOAL                                               VARCHAR2(12)
    DTP                                                VARCHAR2(1)
    ENABLED                                            VARCHAR2(3)
    AQ_HA_NOTIFICATIONS                                VARCHAR2(3)
    CLB_GOAL                                           VARCHAR2(5)http://docs.oracle.com/cd/B19306_01/rac.102/b14197/srvctladmin.htm

  • How to get the status of the method

    Hi,
    I have created a services and method to start the processes.
    Method:
    #!/sbin/sh
    . /lib/svc/share/smf_include.sh
    case "$1" in
    'start')
    /usr/local/proce start
    sleep 10
    'stop')
    /usr/local/proce stop
    echo "Usage: $0 { start | stop }"
    exit 1
    esac
    exit $SMF_EXIT_OK
    Here am exit with SMF_EXIT_OK.
    How can I get the status of start and stop whether it is successful or failure.
    In the place of SMF_EXIT_OK I need to return the status of start and stop.
    Please help me in solving this.
    When i check in smf-include.sh , i got the following exit level
    SMF_EXIT_OK=0
    SMF_EXIT_ERR_FATAL=95
    SMF_EXIT_ERR_CONFIG=96
    SMF_EXIT_MON_DEGRADE=97
    SMF_EXIT_MON_OFFLINE=98
    SMF_EXIT_ERR_NOSMF=99
    SMF_EXIT_ERR_PERM=100
    Regards,
    Kalai

    ss

  • How can I get the status bar back on my web page

    I want to get the status bar on the bottom of the web page so that I can slide from left to right if an article is too large for my monitor. I had it this morning 1-5-15. After checking out Thunderbird as an option for my email, the bar disappeared after uninstalling Thunderbird. I know about hovering over the web pages I have on my menu bar, but I would rather have the entire bar at bottom of page.
    The gray bar shows up in my email only. I would like to have it on all my websites.
    Thank you.

    Does the scroll bar appear if you maximize the window or possibly switch to full screen mode via F12?
    You can try to open the system menu via Alt+Space and see if you can resize the window in case the current window is too high and the horizontal scroll bar falls off.
    Try to open a new window in case there is a problem with the current window.
    You can check for problems caused by a corrupted xulstore.rdf file.
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • How can i get the status of the loaded database in OCI ??

    Hi, buddy!
    Now i wanna get the status of the loaded database,example MOUNT, NOMOUNT,OPEN. Can i use the OCI interface to get it? if it like that,
    how can i do? Otherwise, is there another way to do in program??
    thanks!!

    My friend, thank you very much for your help!
    I have tryed according to you advice. The result is that i can connect database successfully only when the database is in the OPEN mode. I use the V$DATABAES table to find the open_mode and of course the result is OPEN, so it's correct.
    But when the database is in the MOUNT or NOMOUNT mode, i can't connect the database successfully.It will throw the exception "ORA-01033: ORACLE initialization or shutdown in progress".
    Could you tell me why? Special thanks!!!
    Message was edited by:
    user588906

  • How to get the status idoc from recieveing system

    Hi All,
    In our requirement we will be sending an idoc to the recieveing system. we are planning to get the staus of the idoc.
    How can you  recieve the status of the idoc that idoc has been is saftly reached to target server.
    Can any one share the solution if you have confirgured  the same before.
    We are planning to use : Middleware.

    Hi Anil,
    If get the status 03 means your idoc successfully send to receiving system port. But in the receiving system if there any issue in processing you can't get these updated status automatically from receiving system. You know Idoc works in asynchronous mode. To get the status you need send one idoc with status (error , success ot warning) from receiving system to sending system.
    Thanks
    Subhankar.

  • How to get the status of Javascript inside a java class

    Hi,
    Can anybody let me know the way by which I can get the status of Javascript (enabled/disabled) in browser inside a Java Class.
    I do have a trick -
    <input type="hidden" name="jstatus" value="disabled">
    <input type="submit" name="submit" onClick="doChecking()">
    <script language= javascript>
    function doChecking()
    document.form.jstatus.value = "enabled";
    submit();
    Now inside our java class we can check the value of "jstatus" if it is disabled then it is disabled else it is enabled.
    Ha ha wat a stupid trick...... ;-)
    Plz let me know a real approach to determine the Javascript status.
    Cheers !!!
    Irshad

    Actually, I don't think that trick is stupid at all. Javascript and Java are normally in no way related (javascript is just plain text content to your servlets / jsp's). So a good way of getting such information to your server is submitting it, like you do.
    Another possibility would be to do it with Ajax in the background, but that all depends on what you do with the information.

  • How to get the status of the backgroud job?

    Hi all,
    I have a job, there are two steps. I have checked in the table TBTCP, the status is always 'P', which means:job step scheduled, even the step is finished. How can we get the status of every step? Many thanks in advance!

    try FM  BP_JOB_STATUS_GET
    but Table TBTCO(field-status) gives the status of the job i.e whether scheduled,released,active,finished,ready or terminated job.
    check  following tables
    <b>TBTCJSTEP - Background Job Step Overview
    TBTCO - Job Status Overview Table
    TBTCP - Background Job Step Overview</b>
    Message was edited by:
            Vasu G

  • How to get the status of workflow

    Hi all,
    Please help me with a query to get the status of a worflow. For Eg: The close order line wf has fired for a particular order line in Oracle Apps (item type = OEOL). I just want to find the status of this using a query. Any hints will be very helpful.
    thank you.

    Look in the ORABPEL database schema. There you will see a lot of tables related to workflow.
    Marc

  • How to get the status of MessageBridge STATUS consistently?

    Hi
    I am using Mbean to get the status of messaging Bridge.
    try {
    Iterator iterator = localHome.getMBeansByType("MessagingBridgeRuntime").iterator();
    while (iterator.hasNext()) {
    MessagingBridgeRuntimeMBean bridgeInfo = (MessagingBridgeRuntimeMBean)iterator.next();
    if (bridgeInfo != null && bridgeInfo.getName().indexOf(bridgeName) > 0 )
    return bridgeInfo.getState();
    } catch (Throwable e) {
    e.printStackTrace();
    System.out.println("Exception Occured " + e.getMessage() );
    If MessageBridge is active, i am not consistently getting the same status. I am getting active. when i ask second time it is returning ""(blank). But when i refreshed using admin console, i will again get the correct status.
    Please help me to resolve this issue.

    Hi
    I am using Mbean to get the status of messaging Bridge.
    try {
    Iterator iterator = localHome.getMBeansByType("MessagingBridgeRuntime").iterator();
    while (iterator.hasNext()) {
    MessagingBridgeRuntimeMBean bridgeInfo = (MessagingBridgeRuntimeMBean)iterator.next();
    if (bridgeInfo != null && bridgeInfo.getName().indexOf(bridgeName) > 0 )
    return bridgeInfo.getState();
    } catch (Throwable e) {
    e.printStackTrace();
    System.out.println("Exception Occured " + e.getMessage() );
    If MessageBridge is active, i am not consistently getting the same status. I am getting active. when i ask second time it is returning ""(blank). But when i refreshed using admin console, i will again get the correct status.
    Please help me to resolve this issue.

  • How to get the status of ASM intance in 11gr2

    hello all
    srvctl status asm -n <node name> gives the status of asm instance. with out using srvctl command how can we get the status of asm instance. ps can be help ful ? if so which is the process need to be checked for ?
    any other ways to do it?
    thanks in advance...

    You can query V$ASM_DISKGROUP,V$ASM_DISK or V$ASM_CLIENT.
    You can also check status of ASM background processes.
    http://download.oracle.com/docs/cd/B28359_01/server.111/b31107/asminst.htm#CHDCFCBJ

Maybe you are looking for

  • Persistant Transient VO Attributes

    I'm experiencing some problems related to persistant transient attributes in view objects under 9.0.4 on Windows (yes I understand it's a preview release, but wanted verify this problem to see if anyone as seen anything similiar). I have a view objec

  • Set prompt in .cshrc causing startup timeout in 4.3

    In our generic login for csh users, we set the prompt with: if ($?prompt) then if ($?tcsh) then set prompt='%m(%n)\!: ' else set prompt='`uname -n`(`whoami`)\!: ' endif endif This works with a console login, an ssh, etc. for Solaris and RHEL systems.

  • Can I Transfer Dot Mac Pages to iWeb?

    Do any of you know if it is possible to take web pages I created using the online templates with Dot Mac (http://homepage.mac.com/bingalls) and move them into iWeb for editing? My plan will be to move all of my pages to my own domain but people are u

  • Snow Leopard 10.6.2 acting up with an LG W1934S

    My silver MacBook running Snow Leopard 10.6.2 is acting up with my LG W1934S, it doesn't detect it at all and I am unable to use the monitor's native resolution. Any help or a clue?

  • Blackberry 9320 HELP PLEASE !!!!

    My blackberry can seem to turn on and all it does is the red light appear and the blackberry sign turn up and it load half way through and then the red light start flashing. sometimes it turn on but then it automatically closes within 1-5 min. i try