Same EMP NUM in multiple cursors

My plsql program is designed in such way that there are multiple cursors & each cursor needs input as EMPLOYEE NUMBER.
This EMPLOYEE NUMBER should be same across all the cursors.
Code is as below.
Any kind of help here is appreciated. Thank you in advance.
-- AGTSP
SET SERVEROUTPUT ON
alter session set nls_date_format='YYYY-MM-DD';
DECLARE
    MY_FILE_DIR varchar2(40) := '/usr/tmp2';
    l_output        utl_file.file_type;
    v_file_handle varchar2(30) default 'Legacy_Job_Data.csv';
    buf varchar2(10230);
    v_ps_id varchar2(10);
    v_job_descr varchar2(40);
  v_belonging_name VARCHAR2(100);
  v_sg VARCHAR2(4);
  v_sg_jc VARCHAR2(6);
  v_EFFECTIVE_START_DATE DATE;
  SG VARCHAR2(10);
  v_count number;
-- CJL DATA COLLECTION STARTS
-- CURSOR STARTS
    CURSOR C_MAIN IS        
  select
                    EMP.EMPLOYEE_NUMBER AS EMPLOYEE_NUMBER
  , JOB.BELONGING_NAME
  , JOB.CHANGE_REASON_NAME
  , JOB.EFFECTIVE_START_DATE
  , JOB.EFFECTIVE_END_DATE
                from
                    apps.zshr_employee_v EMP
                    , apps.ZSHR_ASSIGNMENT_V JOB
                where
                    EMP.EMPLOYEE_NUMBER = JOB.EMPLOYEE_NUMBER
                and TO_CHAR( EMP.EFFECTIVE_END_DATE , 'YYYY-MM-DD')='4712-12-31'                and JOB.QUALIFICATION_CODE <>'0151'
  ORDER BY EFFECTIVE_START_DATE DESC
CURSOR C_SCM IS        
  SELECT
                    EMP.EMPLOYEE_NUMBER AS EMPLOYEE_NUMBER
  , JOB.BELONGING_NAME
  , JOB.CHANGE_REASON_NAME
  , JOB.EFFECTIVE_START_DATE
  , JOB.EFFECTIVE_END_DATE
                from
                    apps.zshr_employee_v EMP
                    , apps.ZSHR_ASSIGNMENT_V JOB
                where
                    EMP.EMPLOYEE_NUMBER = JOB.EMPLOYEE_NUMBER
               and TO_CHAR( EMP.EFFECTIVE_END_DATE , 'YYYY-MM-DD') ='4712-12-31' and TO_CHAR( JOB.EFFECTIVE_END_DATE , 'YYYY-MM-DD') <'2008-08-01'
  and TO_CHAR( JOB.EFFECTIVE_START_DATE , 'YYYY-MM-DD') >= '1987-07-01'
  and JOB.QUALIFICATION_CODE <>'0151'
  and rownum=1
  ORDER BY EFFECTIVE_START_DATE ASC
CURSOR C_CM IS        
  SELECT
                    EMP.EMPLOYEE_NUMBER AS EMPLOYEE_NUMBER
  , JOB.BELONGING_NAME
  , JOB.CHANGE_REASON_NAME
  , JOB.EFFECTIVE_START_DATE
  , JOB.EFFECTIVE_END_DATE
        from
                    apps.zshr_employee_v EMP
                    , apps.ZSHR_ASSIGNMENT_V JOB
                where
                    EMP.EMPLOYEE_NUMBER = JOB.EMPLOYEE_NUMBER
               and TO_CHAR( EMP.EFFECTIVE_END_DATE , 'YYYY-MM-DD') ='4712-12-31' and TO_CHAR( JOB.EFFECTIVE_START_DATE , 'YYYY-MM-DD') < '1987-07-01'
  and rownum =1
  ORDER BY EFFECTIVE_START_DATE ASC
-- MAIN BODY BEGINS
BEGIN
-- FILE INITIALIZATION
    l_output := utl_file.fopen(MY_FILE_DIR,v_file_handle, 'w', 32767);
-- WRITING THE FILE HEADER STARTS
    buf := 'EMPLID'
                || ',EMPL_RCD'
                || ',EFFDT'
                || ',EFFSEQ'
                || ',CX_EE_ID_NBR'
                || ',CX_SECT_NM'
                || ',LOCATION'
                || ',CX_WRK_LOC_DESCR'
                || ',JOBCODE'
                || ',JOB_DESCR'
                || ',GRADE'
                || ',COMPRATE '
                || ',CURRENCY_CODE'
                || ',COMP_FREQUENCY'
    utl_file.put_line(l_output,buf);
FOR C_EMP_rec in C_MAIN LOOP
-- CJL LEGACY JOB DATA COLLECTION
--PS ID EXTRACTION STARTS
  BEGIN
  select PS_ID INTO v_ps_id from apps.TB03569A where
        EBS_ID=C_EMP_rec.EMPLOYEE_NUMBER;
  EXCEPTION
  WHEN no_data_found THEN
  v_ps_id := 'NO DATA';
  END;
--PS ID EXTRACTION END
  IF  C_EMP_rec.EFFECTIVE_START_DATE >= '2008/8/1' THEN
    buf := v_ps_id                               /* EMPLID */
           || ',' || 0                             /* EMPL_RCD */
           || ',' || C_EMP_rec.EFFECTIVE_START_DATE         /* EFFDT*/
           || ',' || 0                             /* EFFSEQ*/
           || ',' || C_EMP_rec.EMPLOYEE_NUMBER             /* CX_EE_ID_NBR */
             || ',' || C_EMP_rec.BELONGING_NAME     /* CX_SECT_NM */
             || ',' || ''                 /* LOCATION */
           || ',' || 'CX_WRK_LOC_DESCR'               /* CX_WRK_LOC_DESCR */
             || ',' || C_EMP_rec.SG_JOB_CODE /* JOBCODE */
             || ',' || v_job_descr               /* JOB_DESCR */
             || ',' || C_EMP_rec.SG         /* GRADE */
           || ',' || ''       /* COMPRATE */
             || ',' || 'JPY'               /* CURRENCY CODE */
             || ',' || '' /* COMP FREQUENCY */
             || ',' || C_EMP_rec.EMP_SG_T_O_FLG           /* SG T Oth. Flag */
  utl_file.put_line(l_output,buf);
  END IF;
END LOOP;
FOR C_SCM_rec in C_SCM LOOP
--PS ID EXTRACTION STARTS
  BEGIN
  select PS_ID INTO v_ps_id from apps.TB03569A where
        EBS_ID=C_SCM_rec.EMPLOYEE_NUMBER;
  EXCEPTION
  WHEN no_data_found THEN
  v_ps_id := 'NO DATA';
  END;
--PS ID EXTRACTION END
buf := v_ps_id                               /* EMPLID */
           || ',' || 0                             /* EMPL_RCD */
           || ',' || C_SCM_rec.EFFECTIVE_START_DATE         /* EFFDT*/
           || ',' || 0                             /* EFFSEQ*/
           || ',' || C_SCM_rec.EMPLOYEE_NUMBER             /* CX_EE_ID_NBR */
             || ',' || C_SCM_rec.BELONGING_NAME     /* CX_SECT_NM */
             || ',' || ''                 /* LOCATION */
           || ',' || 'CX_WRK_LOC_DESCR'               /* CX_WRK_LOC_DESCR */
             || ',' || C_SCM_rec.SG_JOB_CODE /* JOBCODE */
             || ',' || 'v_job_descr'               /* JOB_DESCR */
             || ',' || C_SCM_rec.SG         /* GRADE */
           || ',' || ''       /* COMPRATE */
             || ',' || 'JPY'               /* CURRENCY CODE */
             || ',' || '' /* COMP FREQUENCY */
             || ',' || C_SCM_rec.EMP_SG_T_O_FLG           /* SG T Oth. Flag */
  utl_file.put_line(l_output,buf);
-- SCM DATA COLLECTION STARTS
END LOOP;
-- SCM DATA COLLECTION ENDS
FOR C_CM_rec in C_CM LOOP
--PS ID EXTRACTION STARTS
  BEGIN
  select PS_ID INTO v_ps_id from apps.TB03569A where
        EBS_ID=C_CM_rec.EMPLOYEE_NUMBER;
  EXCEPTION
  WHEN no_data_found THEN
  v_ps_id := 'NO DATA';
  END;
--PS ID EXTRACTION END
  BEGIN
  select count(*) INTO v_count from
  SELECT 
  distinct
  EMP.EMPLOYEE_NUMBER
  , JOB.ASSIGNMENT_NUMBER
  , JOB.ASSIGNMENT_ID
  from
  apps.zshr_employee_v EMP
  , apps.ZSHR_ASSIGNMENT_V JOB
  where
  EMP.EMPLOYEE_NUMBER=JOB.EMPLOYEE_NUMBER
  and EMP.EMPLOYEE_NUMBER=C_CM_rec.EMPLOYEE_NUMBER
  EXCEPTION
  WHEN no_data_found THEN
  v_count := 0;
  END;
  IF v_count > 1 THEN
  v_job_descr := 'MHI';
  ELSE
  v_job_descr := 'CM';
  END IF;
  buf := v_ps_id                           /* EMPLID */
           || ',' || 0                             /* EMPL_RCD */
           || ',' || C_CM_rec.EFFECTIVE_START_DATE         /* EFFDT*/
           || ',' || 0                             /* EFFSEQ*/
           || ',' || C_CM_rec.EMPLOYEE_NUMBER             /* CX_EE_ID_NBR */
             || ',' || C_CM_rec.BELONGING_NAME     /* CX_SECT_NM */
             || ',' || ''                 /* LOCATION */
           || ',' || 'CX_WRK_LOC_DESCR'               /* CX_WRK_LOC_DESCR */
             || ',' || C_CM_rec.SG_JOB_CODE /* JOBCODE */
             || ',' || v_job_descr               /* JOB_DESCR */
             || ',' || C_CM_rec.SG         /* GRADE */
           || ',' || ''       /* COMPRATE */
             || ',' || 'JPY'               /* CURRENCY CODE */
             || ',' || '' /* COMP FREQUENCY */
             || ',' || C_CM_rec.EMP_SG_T_O_FLG           /* SG T Oth. Flag */
  utl_file.put_line(l_output,buf);
-- SCM DATA COLLECTION STARTS
END LOOP;
    utl_file.fclose(l_output);
END;

Well, I'm not sure what you're issue is as you haven't told us.
Typically cursors within cursors or multiple cursors are a bad idea, and you should look to try and combine SQL statements into one statement where possible.
I do however, notice that you've specifying an operating system path for your directory (/usr/tmp2).  You should not use o/s paths with Oracle, you should use Oracle directory objects e.g.
The UTL_FILE_DIR parameter has been deprecated by oracle in favour of direcory objects because of it's security problems.
The correct thing to do is to create a directory object e.g.:
CREATE OR REPLACE DIRECTORY mydir AS 'c:\myfiles';
Note: This does not create the directory on the file system. You have to do that yourself and ensure that oracle has permission to read/write to that file system directory.
Then, grant permission to the users who require access e.g....
GRANT READ,WRITE ON DIRECTORY mydir TO myuser;
Then use that directory object inside your FOPEN statement e.g.
fh := UTL_FILE.FOPEN('MYDIR', 'myfile.txt', 'r');
Note: You MUST specify the directory object name in quotes and in UPPER case for this to work as it is a string that is referring to a database object name which will have been stored in uppercase by default.

Similar Messages

  • Multiple Cursors in an OracleResultSet

    Is it possible to iterate over multiple cursors in an OracleResultSet at the same time, or do you have to iterate over a result set (get all the data), then iterate over another resultset (get all the data). See example code 1 and example code 2 below:
    Example Code 1
    =============
    Map output = new HashMap();
              try {
                   // make connection
                   // send JDBC call
                   ResultSet cursor1 = null;
                   while (cursor1.next()) {
                        CartBean chart = new CartBean();
                        cart.setCartName(cursor1.getString("Name"));
                        cart.setCartType(cursor1.getString("Type"));
                        output.put(cart.getCartName(), cart);
                   ResultSet cursor2 = null;
                   while (cursor2.next()) {
                        CartBean chart = (CartBean) output.get(cursor2
                                  .getString("CartName"));
                        Map series = cart.getSeriesData();
                        series.put(cursor2.getString("Label"), new HashMap());
    Example Code 2
    =============
    Map output = new HashMap();
              try {
                   // make connection
                   // send JDBC call
                   ResultSet cursor1 = null;
                   while (cursor1.next()) {
                        CartBean chart = new CartBean();
                        cart.setCartName(cursor1.getString("Name"));
                        cart.setCartType(cursor1.getString("Type"));
                        output.put(cart.getCartName(), cart);
                   ResultSet cursor2 = null;
                   while (cursor2.next()) {
                        Map series = cart.getSeriesData();
                        series.put(cursor2.getString("Label"), new HashMap());
    }

    Hi Nathan,
    I don't full understand your requirements.  It would help if you could give a bit more background information about what you want to achieve.  Assuming you want one row in temp_store_newta for each store, then the following should do it (untested).
    declare
      l_union sdo_geometry;
      l_remainder sdo_geometry;
    begin
      for r1 in (
      select rowid, store_id, client_id, geometry
      from tmcs.tmcs_all_stores_ta
      where client_id = 1
      and rownum < 4)
      loop
      dbms_output.put_line('The primary --> ' || r1.store_id);
      select sdo_aggr_union(sdoaggrtype(geometry, 0.005))
      into l_union
      from tmcs.tmcs_all_stores_ta
      where client_id = 1
      and sdo_anyinteract(geometry, r1.geometry) = 'TRUE'
      and rowid != r1.rowid;
      l_remainder := sdo_geom.sdo_difference(r1.geometry, l_union, 0.005);
      if l_remainder is not null then
       dbms_output.put_line('Inserting the remainder for ' || r1.store_id);
       insert into tmcs.temp_store_newta values (r1.store_id, r1.store_number, r1.client_id, l_remainder);
      else
       dbms_output.put_line('Nothing left after punching out all the other geometries');
      end if;
    end loop r1;
    commit;
    end;
    John

  • How to use the same POWL query for multiple users

    Hello,
    I have defined a POWL query which executes properly. But if I map the same POWL query to 2 portal users and the 2 portal users try to access the same page simultaneously then it gives an error message to one of the users that
    "Query 'ABC' is already open in another session."
    where 'ABC' is the query name.
    Can you please tell me how to use the same POWL query for multiple users ?
    A fast reply would be highly appreciated.
    Thanks and Regards,
    Sandhya

    Batch processing usually involves using actions you have recorded.  In Action you can insert Path that can be used during processing documents.  Path have some size so you may want to only process document that have the same size.  Look in the Actions Palette fly-out menu for insert path.  It inserts|records the current document work path into the action being worked on and when the action is played it inserts the path into the document as the current work path..

  • Same apple id for multiple devices

    I have been use the same apple id for multiple devices (both are iPhones running iOS 6 - one is a 4, the other a 4S.) I'd like to sync separate content for each device using the same instance of iTunes (iTunes V 10.7 installed on MacBook running OS X 10.6.8.) Can I assign the second device a separate apple id in odrer to differentiate the content? Thanks for your assistance!

    No, a second Apple ID will not work. iTunes can already tell them apart.
    When you connect the first iPhone to iTunes, check and uncheck the things you want and Sync.
    Do the same with the second iPhone.

  • HT204380 Is there a way of using the same FaceTime account on multiple devices?

    Is there a way of using the same FaceTime account on multiple devices?

    Yes you can use the same Apple ID on multiple devices and FaceTime with each one. You have to associate a different email address on all but one of the devices.
    Lets say you have two iPads and two iPods..... All sharing the same Apple ID. When you set up FaceTime on three of the devices, you have to associate another mail address in Settings>FaceTime>You can be reached for Video calls at>Add Another email address. Add a different email address in that setting and let Apple verify the address.
    After that email address has been verified by Apple (they send you an email to that address so look for it in the inboxes of that email account and follow the instructions in the email), then remove the Apple ID email address on each of those three devices. You can use the primary Apple ID email on the fourth device.
    Obviously, you have to have additional email addresses but you can set up free email accounts with AOL, Yahoo, gmail .... and you can use the email address just for FaceTime if you like.

  • Can I use the same Apple ID for multiple devices

    Can I use the same Apple ID for multiple devices?

    Yes. Up to five devices can be authorized on a single computer using the same Apple ID. You can also use the same Apple ID on multiple devices is they are all going to use the same iTunes Library by the same user. But it's ill-advised if multiple users are involved who wish to keep their devices separate from the devices belonging to other users.
    How to use multiple iPhone, iPad, or iPod devices with one computer
    Using More than One iDevice on the Same Computer
    This applies mainly to couples who are adding another device and do not want their email, messages, etc. being duplicated on both devices. To begin read: How to use multiple iPhone, iPad, or iPod devices with one computer. You need to establish a separate Apple ID and password for whomever will use the new iDevice. See Apple - My Apple ID and Frequently asked questions about Apple ID. The easiest way is to do this on the computer using iTunes: iTunes- How to set up an Apple ID within iTunes.
    On the computer create a new user account for the person with the new iDevice. This will be the user account that person will always use. He/She will no longer use the other user account. This way that person will have a separate iTunes Library
    Start by transferring the new device(s) to a new account along with all your data.  Save any photo stream photos that you want to keep to your camera roll (unless they are already in the camera roll) by opening your Photos app, tap on Albums icon at the bottom. Now, tap on My Photo Stream album; tap Select; tap on the photos you want to select;, tap the share icon (box with upward facing arrow) in the lower left corner; then tap Save to Camera Roll.
    If you are syncing notes with iCloud that you want to keep then you need to open each of your notes and email them to yourself. Later you can copy and paste the text into new notes created in your new account.
    Tap on Settings > iCloud > Delete Account (only deletes it from this device, not from iCloud; the person keeping the current account will not be affected,) provide the password to turn off Find My Phone and choose Keep on My iDevice when prompted.  Sign in with a different Apple ID to create your new account. Choose Merge to upload your data.
    Once you are on separate accounts, you can each go to icloud.com and delete the other person's data from your account.
    Note: The essence of the above was created by user, randers4. I
    have made substantial changes to improve readability and syntax.

  • Can I use the same email address for multiple seats in Creative Cloud for Teams?

    Can I use the same email address for multiple seats in Creative Cloud for Teams?

    No. http://www.adobe.com/products/creativecloud/faq.html
    Can I buy more than one membership to an individual offering of Creative Cloud? 
    No, Adobe has moved to identity-based licensing with a technology that will not support multiple same-product licenses, so you can buy only one membership per Adobe ID. If you need two Creative Cloud memberships, you will need to purchase each with a unique Adobe ID. You can also purchase a Creative Cloud for teams membership, which allows you to purchase and manage multiple seats under one account.

  • Can I use the same administrator password on multiple devices

    Can I use the same administrator password on multiple devices?  (ie) MacBook Pro and Powerbook G 4

    Hello,
    I use the same password on all my Macs. Provided you have set the user accounts with the same password, you will be fine.

  • Can we use the same credit card for multiple customers???

    One of my clients has a requirement where they need to use the same Credit Card number for multiple customers. I have looked into the possibility of using the 'Alternate Payer' functionality but besides that is there any other way SAP can be tweaked to accept the same credit card on multiple customer accounts?
    Thanks in advance for any help or guidance you may provide.
    SJ

    I know SAP throws an error message which is why I was looking for a solution. I do have a work around. By pointing to an 'Alternate Payer' on the Payment Transactions tab on the customer master you can have a credit card on this alternate payer master record and use this payer on several other customers. All these customers will not have any credit card stored on their master records.
    Thanks for your response though.

  • Prevent the same user login on multiple computers at the same time

    prevent the same user login on multiple computers at the same time

    Is there any way (currently running 2012 Servers) that we can prevent users from logging into multiple domain computers simultaneously with the same username?
    We still want them to log into those computers, just not simultaneously?
    LimitLogin utility not work in Windows 2012 server.
    Thanks.
    Babu
    Unfortunately Windows has never offered this feature as a built-in feature, but there are several possibilities discussed in these articles:
    https://social.technet.microsoft.com/Forums/windowsserver/en-US/0103b5e7-0db5-4fb4-bfe7-d7132983880a/limit-concurrent-logins-on-a-ws-2008-environment
    http://www.edugeek.net/forums/windows-server-2008-r2/61216-multiple-logins.html
    http://windowsitpro.com/windows/prevent-multiple-logons-gpos
    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

  • Effect of Multiple cursors in Function Module Extractors

    Hi,
    I am trying to use multiple cursors in an FM extractor, like this:
    OPEN CURSOR WITH HOLD c1 FOR <select query 1>.
    OPEN CURSOR WITH HOLD c2 FOR <select query 2>.
    FETCH NEXT CURSOR c1
                   INTO CORRESPONDING FIELDS
                   OF TABLE i_equi.
    FETCH NEXT CURSOR c2
                   APPENDING CORRESPONDING FIELDS
                   OF TABLE i_equi.
    " Further processing of equipments
    " obtained in i_equi
    I am also checking SY-SUBRC, after each Fetch statement. If both cursors happen to be empty, the extractor exits by raising no_more_data, like other extractors.
    It is possible to do so, since I just tried it. The question is, are there any disadvantages of this kind of approach in terms of memory or speed?
    Edited by: Suhas Karnik on Sep 29, 2008 12:06 PM

    hI kiran,
    The simple way is to create a data element & domain with value range where u provide set of fixed values or provide a check table to it.
    Use that data element in a table <ztable>.
    Code:
    Parameters:
          p_burks like <ztable>-dataelement.
    Call Function <function_name>
    exporting
    p_burks = p_burks,

  • How to add (multiple) cursors programmatically in an XY graph?

     how to add (multiple) cursors programmatically in an XY graph?
    I am building an XY graph. then I would like to add cursors at certain locations (positioned on x axis) I determine through a program.
    How can I add cursors programatically?
    Thank you.

    Initialize a cluster array (CrsrList type) with as many cursors as you think you would ever need.   Setup your cursors dynamically, then delete the unused cursors (array elements) and then update your CursorList property.
    Message Edited by vt92 on 03-20-2009 04:04 PM
    "There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
    Attachments:
    cursors.PNG ‏5 KB

  • Can we control order of cycling when use same access key in multiple locations

    Hi,
    I'm using Jdev 11.1.1.6, IE 9, Firefox 24.0.
    I have created simple jspx page having two buttons, named Add and Close. Close button has got access key as C. When click on Add button I'm calling a <af:popup> and that popup contains two buttons Submit and Cancel. Cancel button has got access key as C. Basically in one jspx file I have got two button using same access key. At runtime those buttons will display one in page and one in popup. 
    In IE: it works fine. When I do access key on popup it will close down the popup.
    In Firefox: it will first focus to the button on the page. When I access the same key for the second time it will set the focus to button on popup and will not execute the action.
    If I'm using different letters it will perform the action in firefox and IE both. In my requirement I need to use the same letter.
    I read in oracle documentation "If the same accessKey appears in multiple locations in the same page of output, the rendering user agent will cycle among the elements accessed by the similar keys.". So it seems to be an expected behaviour.
    My question is: Can we control the order of cycling. i.e. If we do access key on popup, can we first focus on the button in popup instead of button on the page in firefox.?
    Greatly appreciate your ideas.
    Thanks.

    Hi,
    unfortunately yes, the cycling behavior is up to the browser.
    Frank

  • "multiple cursor in a procedure" is possible?

    Hi.. everyone.
    Is it possible , "multiple cursor in one procedure"?
    For example,
    create or replace procedure xxx
    is
    vAAA varchar2(10);
    vBBB varchar2(10);
    cursor cur_1 is select .............................;
    cursor cur_2 is select .............................;
    begin
    -- the first cursor
    open cur_1;
    loop
    end loop;
    close cur_1;
    -- the second cursor
    open cur_2;
    loop
    end loop;
    close cur_2;
    end;
    If it is not possible, what is the way to use
    multiple cursor(more than 2) in ONE procedure?
    Thanks in advance.
    Have a nice day.
    Ho.

    no problem
    SQL> drop procedure xxx;
    Procedure dropped.
    SQL> CREATE OR REPLACE
      2  procedure xxx
      3  is
      4  vAAA varchar2(10);
      5  vBBB varchar2(10);
      6  cursor cur_1 is select employee_id from employees where rownum < 2;
      7  cursor cur_2 is select department_id from departments where rownum < 2;
      8
      9  begin
    10  -----------------------------------------------
    11  -- the first cursor
    12  -----------------------------------------------
    13  dbms_output.put_line('Cursor 1 Result');
    14  open cur_1;
    15  loop
    16    fetch cur_1 into vAAA;
    17    exit when cur_1%notfound;
    18    dbms_output.put_line(vAAA);
    19  end loop;
    20  close cur_1;
    21  -----------------------------------------------
    22  -- the second cursor
    23  -----------------------------------------------
    24  dbms_output.put_line('Cursor 2 Result');
    25  open cur_2;
    26  loop
    27    fetch cur_2 into vBBB;
    28    exit when cur_2%notfound;
    29    dbms_output.put_line(vBBB);
    30  end loop;
    31  close cur_2;
    32  -----------------------------------------------
    33  end;
    34  /
    Procedure created.
    SQL> execute xxx;
    Cursor 1 Result
    100
    Cursor 2 Result
    10
    PL/SQL procedure successfully completed.

  • [Help] statement.executeQuery(query) opens MULTIPLE cursors

    Hey everyone,
    I'm having a real hard time finding anything about this on the net so I've turned here. When we call:
    resultSet = statement.executeQuery(query)
    from a servlet for some reason that one executeQuery opens anywhere from 9-12 cursors in our oracle DB. All the executeQuery documentation I could find just said it should open 1 cursor for that particular ResultSet. query is a fairly simple SQL statement, it searches multiple tables but that doesn't explain why it should open so many cursors.
    On a side note the resultSet and statement are global to the method and are closed in the finally block, no SQLExceptions are thrown further adding to my confusion.
    If anyone has seen something like this where executing 1 query opens multiple cursors please let me know any information you might have.
    Thanks in advance
    -Dave

    Hi Dave
    I had a similar problem using the Oracle 8i, but my query was a more complicated than yours and opened a lot of cursors.
    The answer is to close every ResultSet and the Statement:
    while (xxResult.next()){ ... }
    xxResult.close();
    xxResult.getStatement().close();
    This worked for me,
    Good luck,
    Daniel.

Maybe you are looking for

  • Error in Oracle Application Server (export) Version 4.0.7.0 ON Windows NT

    Hi all, I am trying to install Oracle Application Server (Export) Version 4.0.7.0.0 for Windows NT on Windows NT 4.0 SP1.At the time of installation every thing goes smooth but when i try to connect to the specified database which is in the same netw

  • 6500 Radio RDS problem

    When selecting RDS in the Radio settings on my 6500 Slide, a 'dialog box' Proram Error is displayed. The radio acts as a normal FM radio. My SW version is V 04.81 Any with same problem og a solution?

  • Writing a custom UIOutput component

    Hi, I'm attempting to write a custom tag (with facelets) to conditionally render its child components. The tag should be something like this: <mw:menu>   <h:outputText value="blabla"/> </mw:menu>My menu tag will try to a menu file, and if it exists m

  • In PSE 10 - the lasso tool begins then quits

    Please help - the Lasso tool begins, goes a short distance and then quits. Both the tool loop and the dotted line stops. If I continue and then let up a dotted line returns but not over the area I outlined. Any suggestions? I just up graded my ram to

  • Error in uploading time hierarchy data to the cloud

    I am having a trouble in updating a dataset with a time hierarchy. I created a dataset in the local LUMIRA desktop from an excel sheet, add a time hierarchy, and tried to upload the dataset to the LUMIRA cloud. However, the system gave me an error an