Loop 2 times on same cursor

Hi,
If you open a cursor and loop on it, and after the loop is finished, then loop on it again (without closing the cursor in between), will it loop again on the same data as was queried during the opening of the cursor? In other words, will the read-consistency of the active set created when opening the cursor be maintained when looping the second time?
I need to check the data of table A, against table B (= first loop), and then empty table B and fill it with the data from table A (= second loop). But I need to be sure that the data from table A used to compare in the first loop, is exactly the data that is written to table B.
Thanks,
Roel

Hi, Roel,
Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables.
Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
If you're asking about a DML statement, such as UPDATE, the CREATE TABLE and INSERT statements should re-create the tables as they are before the DML, and the results will be the contents of the changed table(s) when everything is finished.
Always say which version of Oracle you're using.
It's unclear why you need two cursors. You can probably do everything you want to in a single MERGE statement, especially if you're using Oracle 11, where MERGE can DELETE rows.

Similar Messages

  • How can i use the same cursor in a loop fro multipletimes.

    I am using two cursors.One to fetch sites and the other to fetch participants under each site.I am performing some job with that participants data.Now the problem is i am using the 2nd cursor in a loop.So it fetches the data of participants falling under one state.But when it comes to the second state,as the second cursor is already open it is unable to fetch the records.Please help me .How can i use the same cursor in a loop fro multipletimes.
    I am sending the code which i have written in When-Button-Pressed-Trigger...
    declare
         sid number;
         pid number;
    cursor csid is select distinct(site_id) from cyber_ppt;
    cursor cpid is select pc_id,st_dt,ed_dt from cyber_ppt where site_id = sid;
         stdt varchar2(10);
         eddt varchar2(10);
         nom number;
         stmonth varchar2(10);
         edmonth varchar2(10);
         cjan number:=0;
         cfeb number:=0;
         cmar number:=0;
         capr number:=0;
         cmay number:=0;
         cjun number:=0;
         cjul number:=0;
         caug number:=0;
         csep number:=0;
         coct number:=0;
         cnov number:=0;
         cdec number:=0;
         i number:=1;
    begin
         open csid ;
         loop
         fetch csid into sid;
              exit when csid %notfound;
              message(sid);
         open cpid;
         loop
         fetch cpid into pid,stdt,eddt ;
         exit when cpid %notfound;
         message(sid||'-'||pid);
         stmonth:=substr(stdt,4,3);
         edmonth:=substr(eddt,4,3);
         nom:= months_between(eddt,stdt);
    while i <= round(nom)
         loop
         stmonth:=substr(stdt,4,3);
    if stmonth='JAN' then
              cjan:=cjan+1;
    elsif stmonth='FEB' then
              cfeb:=cfeb+1;
    elsif stmonth='MAR' then
              cmar:=cmar+1;
    elsif stmonth='APR' then
              capr:=capr+1;
    elsif stmonth='MAY' then
              cmay:=cmay+1;
    elsif stmonth='JUN' then
              cjun:=cjun+1;
    elsif stmonth ='JUL' then
              cjul:=cjul+1;
    elsif stmonth ='AUG' then
              caug:=caug+1;
    elsif stmonth ='SEP' then
              csep:=csep+1;
    elsif stmonth ='OCT' then
              coct:=coct+1;
    elsif stmonth ='NOV' then
              cnov:=cnov+1;
    elsif stmonth ='DEC' then
              cdec:=cdec+1;
    end if;
         stdt:=add_months(stdt,1);
         i:=i+1;
         end loop;
         end loop;
         end loop;
         end;
         

    try this /* untested */
    DECLARE
    sid           NUMBER;
    pid           NUMBER;
    CURSOR csid IS SELECT DISTINCT(site_id) FROM cyber_ppt;
    CURSOR cpid(nSid NUMBER) is SELECT pc_id,st_dt,ed_dt FROM cyber_ppt WHERE site_id = nSid;
    stdt        VARCHAR2(10);
    eddt        VARCHAR2(10);
    nom         NUMBER;
    stmonth     VARCHAR2(10);
    edmonth     VARCHAR2(10);
    cjan         NUMBER:=0;
    cfeb         NUMBER:=0;
    cmar         NUMBER:=0;
    capr         NUMBER:=0;
    cmay         NUMBER:=0;
    cjun         NUMBER:=0;
    cjul         NUMBER:=0;
    caug         NUMBER:=0;
    csep         NUMBER:=0;
    coct         NUMBER:=0;
    cnov         NUMBER:=0;
    cdec         NUMBER:=0;
    i            NUMBER:=1;
    BEGIN
    FOR rec IN csid
    LOOP
                      sid := rec.csid;
    FOR cRec IN cpid(sid)
    LOOP
                     pid := cRec.pc_id;
                     stdt := cRec.st_dt;
                     eddt := cRec.ed_dt;
    stmonth:=  SUBSTR(stdt,4,3);
    edmonth:= SUBSTR(eddt,4,3);
    nom:= months_between(eddt,stdt);
    WHILE i <= round(nom)
    LOOP
              stmonth := SUBSTR(stdt,4,3);
    IF stmonth='JAN'
    THEN
             cjan:=cjan+1;
    ELSIF stmonth='FEB' THEN
             cfeb:=cfeb+1;
    ELSIF stmonth='MAR' THEN
              cmar:=cmar+1;
    ELSIF stmonth='APR' THEN
              capr:=capr+1;
    ELSIF stmonth='MAY' THEN
              cmay:=cmay+1;
    ELSIF stmonth='JUN' THEN
              cjun:=cjun+1;
    ELSIF stmonth ='JUL' THEN
              cjul:=cjul+1;
    ELSIF stmonth ='AUG' THEN
              caug:=caug+1;
    ELSIF stmonth ='SEP' THEN
              csep:=csep+1;
    ELSIF stmonth ='OCT' THEN
              coct:=coct+1;
    ELSIF stmonth ='NOV' THEN
              cnov:=cnov+1;
    ELSIF stmonth ='DEC' THEN
              cdec:=cdec+1;
    END IF;
             stdt:=add_months(stdt,1);
             i:=i+1;
    END LOOP;
    END LOOP;
    END LOOP;
    END;

  • Stopping producer consumer loop at the same time

    In my application I am using producer consumer architecture. In the producer loop, I am acquiring data, processing and outputting the result (feedback control system). Also in the same producer loop I am inputting all the data to a queue and then in the consumer loop I am writing data to a file. I have a stop control on the front panel and error from the queue and  error from the data acquisition all wired to OR gate to stop the while loop. ( I attached the picture of the code). Whenever I press stop form the front panel program wont completely stop. I think it is because consumer loop still running. Is there way to stop  the both loops at the same time. I tried creating local variable but it slows the program. Front panel stop control mechanical action is set to switch when released.
    Attachments:
    app.PNG ‏262 KB

    In the consumer loop you should check the error after the Read Queue function.
    TOn
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Can multiple threads share the same cursor in berkeley db java edition?

    We use berkeley db to store our path computation results. We now have two threads which need to retrieve records from database. Specifically, the first thread accesses the database from the very beginning and read a certain number of records. Then, the second thread needs to access the database and read the rest records starting from the position where the cursor stops in the first thread. But, now, I cannot let these two threads share the same cursor. So, I have to open the database separately in two threads and use individual cursor for each thread. This means I have to in the second thread let the cursor skip the first certain number of records and then read the rest records. However, in this way, it is a waste of time letting the second thread skip a certain of records. It will be ideal for us that the second thread can start reading the record just from the place where the first thread stops. Actually, I have tried using transactional cursor and wanted to let the two threads share the same transactional cursor. But it seems that this didn't work.
    Can anyone give any suggestion? Thank you so much!
    sgao

    If your question is really about using the BDB Java Edition product please post to the JE forum:
    Berkeley DB Java Edition
    If your question is about using the Java API of the BDB (C-based) product, then this is the correct forum.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Execution time of same program makes big difference

    Hello all,
    The execution time of same program in PRD system and QAS system makes big difference.
    The difference of data is not much(as system copy was run on a regular time schedule. And the system enviroments are exactly the same. However, while the program only cost 2-3 seconds in QAS, it cost 7-8 minutes in PRD.
    It only happens when trying to join some tables together.
    I've checked the execution plans of same search, they are different:
    QAS:
    SQL Statement
    SELECT
      T_00.RANL , T_00.XALLB , T_00.REPKE , T_00.REWHR , T_00.HKONT ,   T_00.ZTMNAIBRX , T_00.GSART ,
      T_00.ZTMHOYMNX , T_00.ZTMSBKBNX ,   T_00.ZTMSHDAYZ , T_00.ZTMMBHZKP , T_01.BAL_SH_CUR ,
      T_01.ZTMSIHONP ,   T_02.SECURITY_ID , T_02.SECURITY_ACCOUNT
    FROM
      ZTM0108 T_00, ZTM0135 T_01, TRACV_POSCONTEXT T_02
    WHERE
      T_00.MANDT = '350' AND   T_00.BUKRS = 'MC51' AND   T_00.ZTMMCSNGX = '200806' AND
      T_02.SECURITY_ACCOUNT = '0001' AND   T_01.MANDT = '350' AND   T_01.BUKRS = T_00.BUKRS AND
      T_01.ZTMMCSNGX = T_00.ZTMMCSNGX AND   T_01.PARTNER = T_00.REPKE AND   T_02.MANDT = '350' AND
      T_02.SECURITY_ID = T_00.RANL
    Execution Plan
    SELECT STATEMENT ( Estimated Costs = 666 , Estimated #Rows = 72 )
      ---   12 HASH JOIN
    ( Estim. Costs = 666 , Estim. #Rows = 72 )
    Estim. CPU-Costs = 37,505,220 Estim. IO-Costs = 663
    Access Predicates
    --   9 HASH JOIN
    ( Estim. Costs = 268 , Estim. #Rows = 51 )
    Estim. CPU-Costs = 18,679,663 Estim. IO-Costs = 267
    Access Predicates
    --   6 NESTED LOOPS
    ( Estim. Costs = 25 , Estim. #Rows = 38 )
    Estim. CPU-Costs = 264,164 Estim. IO-Costs = 25
    --   4 NESTED LOOPS
    ( Estim. Costs = 25 , Estim. #Rows = 27 )
    Estim. CPU-Costs = 258,494 Estim. IO-Costs = 25
    --   2 TABLE ACCESS BY INDEX ROWID DIFT_POS_IDENT
    ( Estim. Costs = 25 , Estim. #Rows = 24 )
    Estim. CPU-Costs = 253,454 Estim. IO-Costs = 25
    Filter Predicates
    1 INDEX RANGE SCAN DIFT_POS_IDENT~SA
    ( Estim. Costs = 1 , Estim. #Rows = 554 )
    Search Columns: 1
    Estim. CPU-Costs = 29,801 Estim. IO-Costs = 1
    Access Predicates
    3 INDEX RANGE SCAN TRACT_POSCONTEXTID
    Search Columns: 2
    Estim. CPU-Costs = 210 Estim. IO-Costs = 0
    Access Predicates
    5 INDEX UNIQUE SCAN TZPA~0
    Search Columns: 2
    Estim. CPU-Costs = 210 Estim. IO-Costs = 0
    Access Predicates
    ---   8 TABLE ACCESS BY INDEX ROWID ZTM0108
    ( Estim. Costs = 242 , Estim. #Rows = 2,540 )
    Estim. CPU-Costs = 10,811,361 Estim. IO-Costs = 241
    7 INDEX RANGE SCAN ZTM0108~0
    ( Estim. Costs = 207 , Estim. #Rows = 2,540 )
    Search Columns: 3
    Estim. CPU-Costs = 9,790,330 Estim. IO-Costs = 207
    Access Predicates Filter Predicates
          ---   11 TABLE ACCESS BY INDEX ROWID ZTM0135
    ( Estim. Costs = 397 , Estim. #Rows = 2,380 )
    Estim. CPU-Costs = 11,235,469 Estim. IO-Costs = 396
    10 INDEX RANGE SCAN ZTM0135~0
                       ( Estim. Costs = 323 , Estim. #Rows = 2,380 )
                       Search Columns: 3
                       Estim. CPU-Costs = 10,288,477 Estim. IO-Costs = 323
                       Access Predicates Filter Predicates
    PRD:
    Execution Plan
    SELECT STATEMENT ( Estimated Costs = 209 , Estimated #Rows = 1 )
      ---   12 NESTED LOOPS
    ( Estim. Costs = 208 , Estim. #Rows = 1 )
    Estim. CPU-Costs = 18.996.864 Estim. IO-Costs = 207
    --   9 NESTED LOOPS
    ( Estim. Costs = 120 , Estim. #Rows = 1 )
    Estim. CPU-Costs = 10.171.528 Estim. IO-Costs = 119
    --   6 NESTED LOOPS
    Estim. CPU-Costs = 27.634 Estim. IO-Costs = 0
    --   4 NESTED LOOPS
    Estim. CPU-Costs = 27.424 Estim. IO-Costs = 0
    1 INDEX RANGE SCAN TZPA~0
    Search Columns: 1
    Estim. CPU-Costs = 5.584 Estim. IO-Costs = 0
    Access Predicates
    ---   3 TABLE ACCESS BY INDEX ROWID DIFT_POS_IDENT
    Estim. CPU-Costs = 210 Estim. IO-Costs = 0
    Filter Predicates
    2 INDEX RANGE SCAN DIFT_POS_IDENT~PT
    Search Columns: 1
    Estim. CPU-Costs = 210 Estim. IO-Costs = 0
    Access Predicates
    5 INDEX RANGE SCAN TRACT_POSCONTEXTID
    Search Columns: 2
    Estim. CPU-Costs = 210 Estim. IO-Costs = 0
    Access Predicates
    ---   8 TABLE ACCESS BY INDEX ROWID ZTM0108
    ( Estim. Costs = 120 , Estim. #Rows = 1 )
    Estim. CPU-Costs = 10.143.893 Estim. IO-Costs = 119
    7 INDEX RANGE SCAN ZTM0108~0
    ( Estim. Costs = 119 , Estim. #Rows = 1 )
    Search Columns: 4
    Estim. CPU-Costs = 10.142.167 Estim. IO-Costs = 119
    Access Predicates Filter Predicates
          ---   11 TABLE ACCESS BY INDEX ROWID ZTM0135
    ( Estim. Costs = 89 , Estim. #Rows = 1 )
    Estim. CPU-Costs = 8.825.337 Estim. IO-Costs = 88
    10 INDEX RANGE SCAN ZTM0135~0
                       ( Estim. Costs = 88 , Estim. #Rows = 1 )
                       Search Columns: 4
                       Estim. CPU-Costs = 8.823.742 Estim. IO-Costs = 88
                       Access Predicates Filter Predicates
    Could anyone tell me the reason? I've found note 724545 but not sure.
    And, how to read the execution plan?(1 first or 12 first?)
    Best Regards,
    Robin

    Hello Michael.
    Thank you.
    However, the sql statement is same:
    QAS:
    SQL Statement
    SELECT
      T_00.RANL , T_00.XALLB , T_00.REPKE , T_00.REWHR , T_00.HKONT ,   T_00.ZTMNAIBRX , T_00.GSART ,
      T_00.ZTMHOYMNX , T_00.ZTMSBKBNX ,   T_00.ZTMSHDAYZ , T_00.ZTMMBHZKP , T_01.BAL_SH_CUR ,
      T_01.ZTMSIHONP ,   T_02.SECURITY_ID , T_02.SECURITY_ACCOUNT
    FROM
      ZTM0108 T_00, ZTM0135 T_01, TRACV_POSCONTEXT T_02
    WHERE
      T_00.MANDT = '350' AND   T_00.BUKRS = 'MC51' AND   T_00.ZTMMCSNGX = '200806' AND
      T_02.SECURITY_ACCOUNT = '0001' AND   T_01.MANDT = '350' AND   T_01.BUKRS = T_00.BUKRS AND
      T_01.ZTMMCSNGX = T_00.ZTMMCSNGX AND   T_01.PARTNER = T_00.REPKE AND   T_02.MANDT = '350' AND
      T_02.SECURITY_ID = T_00.RANL
    Execution Plan
    SELECT STATEMENT ( Estimated Costs = 666 , Estimated #Rows = 72 )
      ---   12 HASH JOIN
    ( Estim. Costs = 666 , Estim. #Rows = 72 )
    Estim. CPU-Costs = 37,505,220 Estim. IO-Costs = 663
    Access Predicates
    --   9 HASH JOIN
    ( Estim. Costs = 268 , Estim. #Rows = 51 )
    Estim. CPU-Costs = 18,679,663 Estim. IO-Costs = 267
    Access Predicates
    --   6 NESTED LOOPS
    ( Estim. Costs = 25 , Estim. #Rows = 38 )
    Estim. CPU-Costs = 264,164 Estim. IO-Costs = 25
    --   4 NESTED LOOPS
    ( Estim. Costs = 25 , Estim. #Rows = 27 )
    Estim. CPU-Costs = 258,494 Estim. IO-Costs = 25
    --   2 TABLE ACCESS BY INDEX ROWID DIFT_POS_IDENT
    ( Estim. Costs = 25 , Estim. #Rows = 24 )
    Estim. CPU-Costs = 253,454 Estim. IO-Costs = 25
    Filter Predicates
    1 INDEX RANGE SCAN DIFT_POS_IDENT~SA
    ( Estim. Costs = 1 , Estim. #Rows = 554 )
    Search Columns: 1
    Estim. CPU-Costs = 29,801 Estim. IO-Costs = 1
    Access Predicates
    3 INDEX RANGE SCAN TRACT_POSCONTEXTID
    Search Columns: 2
    Estim. CPU-Costs = 210 Estim. IO-Costs = 0
    Access Predicates
    5 INDEX UNIQUE SCAN TZPA~0
    Search Columns: 2
    Estim. CPU-Costs = 210 Estim. IO-Costs = 0
    Access Predicates
    ---   8 TABLE ACCESS BY INDEX ROWID ZTM0108
    ( Estim. Costs = 242 , Estim. #Rows = 2,540 )
    Estim. CPU-Costs = 10,811,361 Estim. IO-Costs = 241
    7 INDEX RANGE SCAN ZTM0108~0
    ( Estim. Costs = 207 , Estim. #Rows = 2,540 )
    Search Columns: 3
    Estim. CPU-Costs = 9,790,330 Estim. IO-Costs = 207
    Access Predicates Filter Predicates
          ---   11 TABLE ACCESS BY INDEX ROWID ZTM0135
    ( Estim. Costs = 397 , Estim. #Rows = 2,380 )
    Estim. CPU-Costs = 11,235,469 Estim. IO-Costs = 396
    10 INDEX RANGE SCAN ZTM0135~0
                       ( Estim. Costs = 323 , Estim. #Rows = 2,380 )
                       Search Columns: 3
                       Estim. CPU-Costs = 10,288,477 Estim. IO-Costs = 323
                       Access Predicates Filter Predicates
    PRD:
    SQL Statement
    SELECT
      T_00.RANL , T_00.XALLB , T_00.REPKE , T_00.REWHR , T_00.HKONT ,   T_00.ZTMNAIBRX , T_00.GSART ,
      T_00.ZTMHOYMNX , T_00.ZTMSBKBNX ,   T_00.ZTMSHDAYZ , T_00.ZTMMBHZKP , T_01.BAL_SH_CUR ,
      T_01.ZTMSIHONP ,   T_02.SECURITY_ID , T_02.SECURITY_ACCOUNT
    FROM
      ZTM0108 T_00, ZTM0135 T_01, TRACV_POSCONTEXT T_02
    WHERE
      T_00.MANDT = '500' AND   T_00.BUKRS = 'MC51' AND   T_00.ZTMMCSNGX = '200806' AND
      T_02.SECURITY_ACCOUNT = '0001' AND   T_01.MANDT = '500' AND   T_01.BUKRS = T_00.BUKRS AND
      T_01.ZTMMCSNGX = T_00.ZTMMCSNGX AND   T_01.PARTNER = T_00.REPKE AND   T_02.MANDT = '500' AND
      T_02.SECURITY_ID = T_00.RANL
    Execution Plan
    SELECT STATEMENT ( Estimated Costs = 209 , Estimated #Rows = 1 )
      ---   12 NESTED LOOPS
          |    ( Estim. Costs = 208 , Estim. #Rows = 1 )
          |    Estim. CPU-Costs = 18.996.864 Estim. IO-Costs = 207
          |--   9 NESTED LOOPS
          |   |   ( Estim. Costs = 120 , Estim. #Rows = 1 )
          |   |   Estim. CPU-Costs = 10.171.528 Estim. IO-Costs = 119
          |   |--   6 NESTED LOOPS
          |   |   |   Estim. CPU-Costs = 27.634 Estim. IO-Costs = 0
          |   |   |--   4 NESTED LOOPS
          |   |   |   |   Estim. CPU-Costs = 27.424 Estim. IO-Costs = 0
          |   |   |   |-----1 INDEX RANGE SCAN TZPA~0
          |   |   |   |       Search Columns: 1
          |   |   |   |       Estim. CPU-Costs = 5.584 Estim. IO-Costs = 0
          |   |   |   |       Access Predicates
          |   |   |   ---   3 TABLE ACCESS BY INDEX ROWID DIFT_POS_IDENT
          |   |   |       |   Estim. CPU-Costs = 210 Estim. IO-Costs = 0
          |   |   |       |   Filter Predicates
          |   |   |       -
    2 INDEX RANGE SCAN DIFT_POS_IDENT~PT
          |   |   |               Search Columns: 1
          |   |   |               Estim. CPU-Costs = 210 Estim. IO-Costs = 0
          |   |   |               Access Predicates
          |   |   -
    5 INDEX RANGE SCAN TRACT_POSCONTEXTID
          |   |           Search Columns: 2
          |   |           Estim. CPU-Costs = 210 Estim. IO-Costs = 0
          |   |           Access Predicates
          |   ---   8 TABLE ACCESS BY INDEX ROWID ZTM0108
          |       |   ( Estim. Costs = 120 , Estim. #Rows = 1 )
          |       |   Estim. CPU-Costs = 10.143.893 Estim. IO-Costs = 119
          |       -
    7 INDEX RANGE SCAN ZTM0108~0
          |               ( Estim. Costs = 119 , Estim. #Rows = 1 )
          |               Search Columns: 4
          |               Estim. CPU-Costs = 10.142.167 Estim. IO-Costs = 119
          |               Access Predicates Filter Predicates
          ---   11 TABLE ACCESS BY INDEX ROWID ZTM0135
              |    ( Estim. Costs = 89 , Estim. #Rows = 1 )
              |    Estim. CPU-Costs = 8.825.337 Estim. IO-Costs = 88
    10 INDEX RANGE SCAN ZTM0135~0
                       ( Estim. Costs = 88 , Estim. #Rows = 1 )
                       Search Columns: 4
                       Estim. CPU-Costs = 8.823.742 Estim. IO-Costs = 88
                       Access Predicates Filter Predicates
    Only difference is the client.
    I see that QAS use index SA on table DIFT_POS_IDENT first, while PRD deal with table TZPA first...Is it the reason?
    Best Regards,
    Robin

  • Is it ok to trigger 2 event loops off the same control?

    I have two event loops which need to trigger when the Exit button is clicked on. Is it ok to trigger both loops off the same control? It has been working great, but I'm not sure if there could be an issue. Please see below. Thank You!
    Solved!
    Go to Solution.

    sfrosty wrote:
    Another point may be that I have  50 ms wired to the timer in the MENU event structure and don't want any delay in the MAIN Event structure. Not sure if this is a valid point.
    Why?  Are you doing something else in that loop?
    I would recommend moving your menue stuff into your main event loop.  You will thank yourself later.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Using Same Cursor Variable

    Hi,
    I have declared a cursor as:
    TYPE T1_CUR IS REF CURSOR;
    T1_REC T1_CUR;
    I want to use the same Cursor variable at multiple places in my PL/SQL procedure by issuing OPEN, FETCH statements.
    Will the file pointer be set at the beginning each time I OPEN it with a SQL statement?
    Thanks

    We can OPEN a ref cursor many times, but we can only FETCH its contents once...
    SQL> DECLARE
      2     TYPE RCTyp IS REF CURSOR;
      3     TYPE T1List IS TABLE OF t1.col1%TYPE;
      4     TYPE T2List IS TABLE OF t2.col1%TYPE;
      5     t_cur RCTyp;
      6     t1s  T1List;
      7     t2s   T2List;
      8  BEGIN
      9      OPEN t_cur FOR SELECT col1 FROM t1;
    10      FETCH t_cur BULK COLLECT INTO t1s;
    11      dbms_output.put_line('#1='||to_char(t1s.COUNT));
    12      OPEN t_cur FOR SELECT col1 FROM t2;
    13      FETCH t_cur BULK COLLECT INTO t2s;
    14      dbms_output.put_line('#2='||to_char(t2s.COUNT));
    15      FETCH t_cur BULK COLLECT INTO t2s;
    16      dbms_output.put_line('#3='||to_char(t2s.COUNT));
    17  END;
    18  /
    #1=9
    #2=3
    #3=0
    PL/SQL procedure successfully completed.
    SQL> Cheers, APC

  • Slow loop times with 6024E and LV2009

    Hello all,
    I have searched the forums back and forth, in addtion to the knowledge base, but I am still confused as to the slow loop times I am experiencing.  I have a 6024e PCMCIA DAQ card with a very simple VI created in LV 2009.  I am using the DAQ Assistant to collect 1 thermocouple channel on a SCXI Chassis 32 channel thermocouple module.
    The problem is that the loop times in labview is about 3 seconds.  The DAQ Assistant acquisition mode is set to "on demand".  The target sample rate is about 1 to 2 samples per second.  I have read in previous posts that the repeated creation of the task using the DAQ Assistant with the acquisition mode set to "on-demand" can slow things down.
    What really has me confused is that using this exact same method of setting the DAQ Assistant acquisition mode to "on-demand" has worked fine on the same hardware when using one of the earlier v8 versions of LabView.  I don't understand what has changed and why the loop times are so much slower.  I planned to pull the newest LV2009 off the computer and put a previous v8 version on just to confirm my observations.  In addition, I pulled up a copy of the VI that was written in one of the v8.x versions and it used the DAQ Assitants with the acquisition mode set to "on-demand" and had a loop time of 0.100 seconds.
    Any help would be appreciated.  I have been working on this all day today with no sucess.
    Thanks in advance,
    Steve

    H_baker,
    I did have the patch applied at the time I was experiencing the problems.  The DAQmx driver version was the version that was supplied on the DVD that we received for LV2009.  I believe the actual version number was something like 8.9.5.
    The loop time was determined as follows:
    A simple vi I was written in a while loop.  The data acquisition was conducted using the DAQ assistant sampling 1 channel on the SCXI thermocouple module in a SCXI 1000 chassis.  Inside the loop of the vi the getdatetime function was placed and wired to an indicator on the screen.  The vi was then ran.  Observation showed that the loop time was typically 3 seconds and sometimes 6 seconds by keeping track of the datetime indicator on the front panel.
    The problem appears to be resolved now.  I had pulled off the LV2009 installation and put back on the 8.6 installation.  Recreated the vi and everything worked fine. As a sanity check I went ahead and reinstalled LV2009.  Recreated the vi again and everything works fine now.  The only real difference between the two installations is that I am using the latest NIDAQmx drives (I believe version 9.0.5).  It could have been just some sort of transient issue that resolved itself either by reinstallation or by rebooting.   Not sure.  I was just initially very concerned given that another posting had mentioned loop times of 3 seconds just like I was experiencing.
    Thanks,
    Steve

  • How to deploy a Webapplication on WAS more than one times on same server?

    Hi all,
    I 've a special problem:
    In our web-app (some DC's) also stored propertie-Files. Now we would to deploy this application more than one times at same server using different WebContentRoots. (f.e. http://server/app1 and http://server/app2 a.s.o.)
    We know, that we must create different EAR-Projects and refer the web-Module and configure the application.
    But in the second application there it's recommended to change some properties.
    How we can handle this in JDI without copy the web-application?
    I hope my question can be understood.
    Best Regards
    Sven Rickelt
    Using Netweaver + WAS 6.40 2004 SP 13

    Hi Sven,
    as I'm new to NWDI, I cannot give you a 100 percent, field-tested solution. But have you already thought about using the Configuration-Adapter?
    If you can change the source of your web-app, you could maintain the data formerly stored in property files using the configuration adapter of visual administrator. The SC <a href="http://help.sap.com/saphelp_nw04/helpdata/en/45/e7e14b517b42788a1c166f9f32455e/content.htm">configuration</a> allows you to access this data.
    With this approach you can stick to one web-application and do the configuration work separately for each deployed application.
    Best regards,
    Frank

  • Silverlight no longer works in FF? Error says it's the fault of Silverlight and to reinstall. Did this 2 times and same error! Silverlight works perfectly in Opra, Chrome, Safari and IE. What gives?

    Just today this happened. Netflix all of a sudden locks up, tried to reload and get error saying it's Silverlights fault and to uninstall/reinstall. Did this and updated Silverlight 2 times. Same issue. Works fine in Safari, Chrome, IE and Opra just fine. Conclusion, FF is at fault not Silverlight. Any fixes for this?

    So it appears Silverlight is working again, sorta. It does load Netflix movies but locks up about every 5 min's, which is totally annoying, then Firefox locks up and I have to ctrl alt delete to close it. I'm really starting to wonder about Firefox. Used to be the best browser, now not so sure. =(

  • Nas on airport extreme not recognized by time machine. same nas was previously used as time machine backup on different airport extreme. are there any configuration files that i can delete to fix this problem ?

    nas on airport extreme not recognized by time machine. same nas was previously used as time machine backup on different airport extreme. are there any configuration files that i can delete to fix this problem ?

    Time Machine has been working just fine, but in the last week or two it has given up the ghost. I reset the connections to the drive, and it will basically save a few bytes of data and then hang.
    Although Apple originally announced, prior to the release of the first 802.11n AirPort Extreme Base Stations (AEBSn), that it would support Time Machine backups to AirPort Disks, they removed that option before they did finally release the base station for sale.
    Since then, Apple has posted (as you have noted) that they DO NOT support Time Machine backups to AirPort Disks. As far as I know, they have not changed from that position and those who do these backups find that they become corrupted over time. Sorry, but it sounds like you just confirmed that for yourself.
    1) Has one of the recent updates either on the AE (firmware) or OSX disabled this function?
    No. Again, this feature has never been supported by Apple for every generation of AEBSn released.
    2) Are there any changes I can make to get this working again?
    If your data backups are critical to you, then you will want to use a different solution for your Time Machine backup destination drive strategy. I would suggest that you connect your WD My Book directly to your Mac in the mean time.
    Your other options would be to either use a Time Capsule (which interestingly does support TM backups to AirPort Disks) or a non-Apple solution like the Drobo FS or HP MediaSmart server.

  • I keep getting an error message ''dbghelp.dll is missing.  please reinstall itunes''  did that 3 times and same results.  can't sync my iphone or even open itunes

    i keep getting an error message ''dbghelp.dll is missing. please reinstall itunes''  did that 3 times and same results.
    i can't sync my iphone and i can't open itunes
    how do i resolve this issue?

    Taken at face value, you're having trouble with a Windows OS dll.
    Perhaps try an sfc /scannow. For instructions, see the following Microsoft document:
    How to use the System File Checker tool to troubleshoot missing or corrupted system files on Windows Vista or on Windows 7

  • Whenever i try to sync iphone5(version8.0.2) with itunes 12 on macbookpro.it appears cannot sync the purchased items on itune store. authorize your computer.i authorized it many times. but same response comes again to authorize.

    whenever i try to sync iphone5(version8.0.2) with itunes 12 on macbookpro.it appears cannot sync the purchased items on itune store. authorize your computer.i authorized it many times. but same response comes again to authorize.

    If you are sure that you are authorizing the correct account/ID then:
    iTunes repeatedly prompts to authorize computer to play iTunes Store purchases

  • 2 different lease time on same scope

    Hi, is it possible to add 2 different lease time on same scope.
    I have server and workstation on the same scope and I want to give the servers longer lease time, than the workstation. 

    Hi
    It is possible to achieve this in the Windows 2012 and higher versions of DHCP Servers using the feature of DHCP policies. You can create a policy within a scope. In that policy you can specify the type of clients you want this policy enabled for. The type
    of clients can be differentiated based on
    MAC Address
    Vendor Class
    User Class
    Client Identifier
    Relay Agent Information (and its sub options – remote id, circuit id and subscriber id)
    in DHCP Server 2012
    and based on FQDN along with above in DHCP Server 2012 R2.
    Once the policy has been created you can set the lease time for the policy as per your needs. For more details you can look at the blog post entry below.
    http://blogs.technet.com/b/teamdhcp/archive/2012/08/22/granular-dhcp-server-administration-using-dhcp-policies-in-windows-server-2012.aspx
    Thanks

  • Some songs in my Ipod classic get get off after a few seconds of playing, but they work fine in ITunes and other Ipods.  I have reset the classic several times and same issue happens, any ideas?

    Some songs in my Ipod classic get get off after a few seconds of playing, but they work fine in ITunes and other Ipods.  I have reset the classic several times and same issue happens, any ideas?

    I have that exact same problem! It plays albums fine. But individual songs including ones downloaded from iTunes either skip or play the music of another totally different song. All play fine on iTunes and my iPhone... Got this one to replace my dying 5th gen classic.
    I hope there is a fix for this, cause it *****!!!!

Maybe you are looking for