Locating Ref Cursors in SGA

We use a lot of ref cursors. These are unnamed, explicit cursors. How can we visualize them in the SGA? None of the existing views show them, because they are unnamed. We need to be able to determine if they're open (to trap memory leaks), how much PGA memory consumed (for footprint analysis), how many clients are sharing them (and who), etc.
null

This works on my 8.1.6.3 database. Have you applied all the patches? (God I sound like Oracle Support!)
rgds, APC

Similar Messages

  • How to write REF-CURSOR Query in Oracle Reports

    Hello Guys!!
    I have a form in which you can select regions/divisions/locations etc by the use of check boxes. And the selected values will be inserted into a table, and based on the selected values of the table the report is run.
    The issue I have is with the query inside the Oracle reports(attached to this file).
    The query works fine until the last two EXISTS conditions.
    IF a region exists In the table report_param then it works fine but if there are no divisions in it , then the query returns no values, which is not correct.
    Someone has advised me to use a ref-cursor query inside reports tool, which I am not aware off. So, anykind of suggestions or advises are welcome. Please let me know about it as it is very urgent issue for me. Anykind of help would be greatly
    appreciated.
    Thanks,
    Vishal
    -------------------------------------------------------Query in Oracle Reports---------------------------------------------------------
    select c.key_segment, p.supplier_id,
    decode(:in_col_nm, 'BRAND',nvl(p.product_brand,'<Unknown Brand>'), 'PLN',nvl(p.product_legal_name,'<Unknown Legal Name>')) COL_NM,
    sum(a.ext_price) sales_dols,
    sum(comp_allow_pkg.get_comp_allow_stddiv(a.control_loc_id, a.product_id, a.sold_to_customer_id,
    a.doc_dt, a.ext_price, a.units)) cust_reb_dols,
    sum(a.units) units,
    sum(a.ext_cost) cost_dols
    from sales a, key_segment_plns c, product p, rep_wrtr_dw_cust h
    where a.doc_dt between :in_start_dt and :in_end_dt
    and a.customer_oc = h.control_loc_id
    and a.sold_to_customer_id = h.sold_to_cust_id
    and a.ship_to_customer_id = h.ship_to_cust_id
    and ((:in_dg_cd = 'B' and h.dealer_grower_cd in ('D','G')) or h.dealer_grower_cd = :in_dg_cd)
    and a.product_id = p.product_id
    and p.product_gl_class_cd = 'CHEM'
    and p.product_legal_name = c.product_legal_name
    and c.key_segment in ('GLYPHOSATE','PLANT HEALTH/RUST FUNGICIDES','PYRETHROIDS','STROBI FUNGICIDES')--&IN_KEY_SEGMENTS
    -- and (:in_oc = 'ALL' or (a.control_loc_id in (select control_loc from control_loc_comb_ocs where control_loc_comb = :in_oc)))
    -- SALES DATA FILTERS TO MATCH ACCUM_SALES_DG_MV
    and a.sale_type_cd in ('02','08')
    and a.document_type_cd in ('I','C','D')
    and (substr(a.product_id,-1) in ('0','1') OR nvl(upper(trim(p.product_brand)),'X') = 'TECH FEE')
    and a.units <> 0
    and a.unit_cost <> 0
    and a.unit_price <> 0
    -- NEW FILTERS ADDED 9/11/07: LOCATION(BRANCH), BUSINESS TYPE, RSM/ASM/REP
    and ((:in_loc = 'ALL') or (nvl(a.warehouse_id,'<blank>') in (SELECT param_value
    FROM report_param
    WHERE report_id = :IN_REPORT_ID
    AND session_id= :IN_SESSION_ID
    AND USER_ID = :IN_USER_ID
    AND param_name='LOCATION_TYPE')))
    and ((:in_uhs_ag = 'ALL') or (:in_uhs_ag = 'NA' and p.product_uhs_ag != 'A') or (p.product_uhs_ag = :in_uhs_ag))
    and ((:in_sales_rep = 'ALL') or (nvl(a.territory_id,'<blank>') in (SELECT param_value
    FROM report_param
    WHERE report_id = :IN_REPORT_ID
    AND session_id= :IN_SESSION_ID
    AND USER_ID = :IN_USER_ID
    AND param_name='SALES_REP_TYPE')))
    and EXISTS
    (SELECT '1'
    FROM locations l, report_param rp
    WHERE rp.report_id = :IN_REPORT_ID
    AND rp.session_id= :IN_SESSION_ID
    AND rp.user_id = :IN_USER_ID
    AND rp.param_value = l.region
    AND rp.param_name = 'REGION_TYPE'
    AND a.warehouse_id = L.ARS_LOCATION)
    and EXISTS
    (SELECT '1'
    FROM locations l, report_param rp
    WHERE rp.report_id = :IN_REPORT_ID
    AND rp.session_id= :IN_SESSION_ID
    AND rp.user_id = :IN_USER_ID
    AND rp.param_value = l.region
    AND rp.param_name = 'DIVISION_TYPE'
    AND a.warehouse_id = L.ARS_LOCATION)
    group by c.key_segment, P.supplier_id,
    decode(:in_col_nm, 'BRAND',nvl(p.product_brand,'<Unknown Brand>'), 'PLN',nvl(p.product_legal_name,'<Unknown Legal Name>'))

    Hi,
    I need your help to create a report using Ref-Cursor. please see the below thread
    Report using ref cursor or dynamic Sql

  • Clarification in ref cursor.

    I have a procedure Pr_job1 with select and followed by insert statements.
    In pr_job1 I am using a ref cursor like open cursor for ‘statement’. This query takes a long time to execute ie more than 20 mins.
    To check the dynamically framed query I gave a insert to a dummy_tab table just below the cursor
    Like ..
    Open p_cv for ‘select statement’;
    Insert into dumm_tab (123,sysdate,’select statement’);
    Commit;
    Loop
    Fetch p_cv into m_rec;
    Exit when p_cv%notfound;
    Rest of the statements.
    End loop;
    In this case finally it gave an error after 20 mins
    Like
    sqlerrm ORA-01652: unable to extend temp segment by 128 in tablespace
    TEMP
    ORA-02063: preceding line from CARSDBP1
    I just checked the v$locked_objects before It gives the error. There I found a lock for the dummy_tab table. My question is will the query will execute for open cursor or while it executes the fetch statement. I ran the query alone in the sql plus window as a normal query. There also I got the table space error.
    Thanks in advance…….
    Regards,
    Jeeva

    user12128516 wrote:
    I have a procedure Pr_job1 with select and followed by insert statements.
    In pr_job1 I am using a ref cursor like open cursor for ‘statement’. This query takes a long time to execute ie more than 20 mins.
    To check the dynamically framed query I gave a insert to a dummy_tab table just below the cursor
    Like ..
    Open p_cv for ‘select statement’;
    Insert into dumm_tab (123,sysdate,’select statement’);
    Commit;
    Loop
    Fetch p_cv into m_rec;
    Exit when p_cv%notfound;
    Rest of the statements.
    End loop;
    In this case finally it gave an error after 20 mins
    Like
    sqlerrm ORA-01652: unable to extend temp segment by 128 in tablespace
    TEMP
    ORA-02063: preceding line from CARSDBP1
    I just checked the v$locked_objects before It gives the error. There I found a lock for the dummy_tab table. My question is will the query will execute for open cursor or while it executes the fetch statement. I ran the query alone in the sql plus window as a normal query. There also I got the table space error.
    Thanks in advance…….
    Regards,
    JeevaHow about you show us an exact copy / paste from SQLPLUS of what you are running? And perhaps you can clarify your question a bit. You have exceeded the allotted amount of space defined for the tablespace in which your table is located, so you should get your local DBA to allocate more space ....
    Aside from that, i'm not sure what your question is about table locking, there are many types of locks, and i have no idea what you viewed that made you suspect the table was locked....

  • [Resolved]VO on Ref Cursor - attempt to save = RowNotFoundException

    I have a view object created from a ref cursor following 27.8.4 in the Oracle Application Development Framework Developer's Guide for Forms/4GL Developers. Using JDev 10.1.2 (yes, old version, but is consistent with all applications on current app server.) following the example at http://www.oracle.com/technology/obe/obe9051jdev/ADFWorkshop/BuildingADFApplicationsWorkshop.htm
    I have a simple table with edit and delete columns on each row. The delete calls an onDelete() method in the browse...Action.java which calls a delete PL/SQL routine. Works great!
    Now the edit calls a form for editing, just like in the OBE.
    In the edit form, I change the displayname input field.
    Press submit, get RowNotFoundException
    press submit again, no errror
    press save - goes back to the table and everything looks great.
    So, what is causing the error, and how can I get this to work on the first press of the save button?
    EditNewslineArchiveAction.onSave()
    public void onSave(DataActionContext ctx) {
    System.out.println("*** EditApplicantAction.onSave() ***");
    DCBindingContainer bindings = ctx.getBindingContainer();
    DCControlBinding binding;
    // For fun, get the current row, and display the key
    try {
    // Get a reference to the currentRow()
    DCIteratorBinding dcIter = bindings.findIteratorBinding("SearchRefCursor1Iterator");
    Row r = dcIter.getCurrentRow();
    System.out.println("Current Row.key = " + r.getKey().toStringFormat(true));
    } catch (Exception e) {
    System.out.println(e.getMessage() );
    e.printStackTrace(System.out);
    // get values from form
    binding = bindings.findCtrlBinding("Masterid");
    String masterId;
    masterId = (binding != null) ? binding.toString() : "";
    System.out.println("masterId = " + masterId);
    binding = bindings.findCtrlBinding("DisplayName");
    String displayName;
    displayName = (binding != null) ? binding.toString() : "";
    System.out.println("displayName = " + displayName);
    if (!(masterId == null)) {
    BindingContext bc = ctx.getBindingContext();
    DCDataControl dc = bc.findDataControl("NewslineArchiveServiceDataControl");
    NewslineArchiveService service = (NewslineArchiveService)dc.getDataProvider();
    service.updateNewslineArchiveItem(masterId,displayName);
    ctx.setActionForward(ctx.getActionMapping().findForward("Save"));
    * if (ctx.getEventActionBinding() != null) {
    * ctx.getEventActionBinding().doIt();
    The onSubmit method just gets a reference to the current row and displays the value in a try catch block.
    There is a onCancel method that sets an action forward, and goes back to the table page view.
    Here is the output from the OC4J window. The "row.key =" is located in the createRowFromResultSet method. The "Current Row.key =" is in both the EditNewslineArchiveAction.onSave() and EditNewslineArchiveAction.onSubmit() methods.
    [Starting OC4J using the following ports: HTTP=8988, RMI=23891, JMS=9227.]
    C:\jdev1012\jdev\system10.1.2.2.0.1929\oc4j-config>
    C:\j2sdk1.4.2_09\bin\javaw.exe -client -classpath C:\jdev1012\j2ee\home\oc4j.jar;C:\jdev1012\jdev\lib\jdev-oc4j.jar -Xverify:none -Ddisable.checkForUpdate=true -Doracle.j2ee.dont.use.memory.archive=true -Doracle.j2ee.http.socket.timeout=500 -Doracle.dms.sensors=NONE -Doc4j.jms.usePersistenceLockFiles=false com.evermind.server.OC4JServer -config C:\jdev1012\jdev\system10.1.2.2.0.1929\oc4j-config\server.xml
    [waiting for the server to complete its initialization...]
    07/05/07 14:39:27 Auto-deploying file:/C:/jdev1012/jdev/mywork/NewslineArchive/ViewController/public_html/ (New server version detected)...
    Ready message received from Oc4jNotifier.
    Embedded OC4J startup time: 2404 ms.
    Target URL -- http://10.141.146.47:8988/NewslineArchive/jsps/index.jsp
    07/05/07 14:39:28 Oracle Application Server Containers for J2EE 10g (10.1.2.2.0) initialized
    May 7, 2007 2:39:28 PM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
    May 7, 2007 2:39:28 PM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
    May 7, 2007 2:39:29 PM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='newslinearchive.view.ApplicationResources', returnNull=true
    May 7, 2007 2:39:29 PM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
    May 7, 2007 2:39:29 PM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
    May 7, 2007 2:39:29 PM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
    May 7, 2007 2:39:29 PM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='org.apache.struts.taglib.bean.LocalStrings', returnNull=true
    07/05/07 14:39:35 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA897800000001000001126844BC10
    07/05/07 14:39:35 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000303A4877800000002000001126844BC10
    07/05/07 14:39:35 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA6F7800000003000001126844BC10
    07/05/07 14:39:35 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA717800000004000001126844BC10
    07/05/07 14:39:35 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA737800000005000001126844BC10
    07/05/07 14:39:35 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA757800000006000001126844BC10
    07/05/07 14:39:35 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA777800000007000001126844BC10
    07/05/07 14:39:35 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA797800000008000001126844BC10
    07/05/07 14:39:35 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA7D7800000009000001126844BC10
    07/05/07 14:39:35 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA83780000000A000001126844BC10
    07/05/07 14:39:35 getQueryHitCount returns the value: 12
    07/05/07 14:39:35 EditApplicantAction.prepareModel() - No events
    07/05/07 14:39:35 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA89780000000B000001126844BC10
    07/05/07 14:39:35 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000303A487780000000C000001126844BC10
    07/05/07 14:39:35 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA6F780000000D000001126844BC10
    07/05/07 14:39:35 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA71780000000E000001126844BC10
    07/05/07 14:39:35 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA73780000000F000001126844BC10
    07/05/07 14:39:35 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA757800000010000001126844BC10
    07/05/07 14:39:35 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA777800000011000001126844BC10
    07/05/07 14:39:35 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA797800000012000001126844BC10
    07/05/07 14:39:35 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA7D7800000013000001126844BC10
    07/05/07 14:39:35 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA837800000014000001126844BC10
    May 7, 2007 2:39:35 PM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
    May 7, 2007 2:39:36 PM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
    07/05/07 14:39:36 getQueryHitCount returns the value: 12
    07/05/07 14:39:39 *** EditNewslineArchiveAction.prepareModel() - before super call
    07/05/07 14:39:39 *** EditNewslineArchiveAction.prepareModel() - after super call
    07/05/07 14:39:39 *** EditNewslineArchiveAction.findForward() - before super call
    07/05/07 14:39:39 *** EditNewslineArchiveAction.findForward() - after super call
    May 7, 2007 2:39:39 PM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
    07/05/07 14:39:44 *** EditNewslineArchiveAction.prepareModel() - before super call
    07/05/07 14:39:44 *** EditNewslineArchiveAction.prepareModel() - after super call
    oracle.jbo.RowNotFoundException: JBO-25020: View row of key oracle.jbo.Key[238727 ] not found in SearchRefCursor1.
    at oracle.jbo.server.remote.RuntimeViewRowSetIteratorInfo.getRowFromKey(RuntimeViewRowSetIteratorInfo.java:505)
    at oracle.jbo.server.remote.RuntimeViewRowSetIteratorInfo.getRowForSvcMsg(RuntimeViewRowSetIteratorInfo.java:471)
    at oracle.jbo.server.remote.RuntimeViewRowSetIteratorInfo.processChanges(RuntimeViewRowSetIteratorInfo.java:367)
    at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.postRows(AbstractRemoteApplicationModuleImpl.java:3433)
    at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgRequest(AbstractRemoteApplicationModuleImpl.java:3480)
    at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgEntries(AbstractRemoteApplicationModuleImpl.java:4129)
    at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.readServiceMessage(AbstractRemoteApplicationModuleImpl.java:3389)
    at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processMessage(AbstractRemoteApplicationModuleImpl.java:1859)
    at oracle.jbo.server.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:7355)
    at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.sync(AbstractRemoteApplicationModuleImpl.java:1825)
    at oracle.jbo.server.remote.colo.ServerApplicationModuleImpl.doMessage(ServerApplicationModuleImpl.java:263)
    at oracle.jbo.common.colo.ColoApplicationModuleImpl.doMessage(ColoApplicationModuleImpl.java:103)
    at oracle.jbo.client.remote.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:6375)
    at oracle.jbo.client.remote.PooledRequestHandler.doMessage(PooledRequestHandler.java:130)
    at oracle.jbo.client.remote.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:6375)
    at oracle.jbo.client.remote.ApplicationModuleImpl.sendServiceMessage(ApplicationModuleImpl.java:1100)
    at oracle.jbo.client.remote.ApplicationModuleImpl.sendServiceMessage(ApplicationModuleImpl.java:1114)
    at oracle.jbo.client.remote.ApplicationModuleImpl.sendWorkingSetRequests(ApplicationModuleImpl.java:3497)
    at oracle.jbo.common.ws.WSApplicationModuleImpl.sendRequests(WSApplicationModuleImpl.java:1119)
    at oracle.jbo.client.remote.ApplicationModuleImpl.sendRequest(ApplicationModuleImpl.java:1148)
    at oracle.jbo.client.remote.ApplicationModuleImpl.validate(ApplicationModuleImpl.java:810)
    at oracle.adf.model.bc4j.DCJboDataControl.validate(DCJboDataControl.java:967)
    at oracle.adf.model.binding.DCBindingContainer.validateInputValues(DCBindingContainer.java:1683)
    at oracle.adf.controller.lifecycle.PageLifecycle.validateModelUpdates(PageLifecycle.java:465)
    at oracle.adf.controller.struts.actions.DataAction.validateModelUpdates(DataAction.java:327)
    at oracle.adf.controller.struts.actions.DataAction.validateModelUpdates(DataAction.java:519)
    at oracle.adf.controller.lifecycle.PageLifecycle.handleLifecycle(PageLifecycle.java:115)
    at oracle.adf.controller.struts.actions.DataAction.handleLifecycle(DataAction.java:222)
    at oracle.adf.controller.struts.actions.DataAction.execute(DataAction.java:153)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
    at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:239)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:669)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:340)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
    at java.lang.Thread.run(Thread.java:534)
    07/05/07 14:39:44 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA897800000015000001126844E401
    07/05/07 14:39:44 *** EditNewslineArchiveAction.findForward() - before super call
    07/05/07 14:39:44 *** EditNewslineArchiveAction.findForward() - after super call
    07/05/07 14:39:46 *** EditNewslineArchiveAction.prepareModel() - before super call
    07/05/07 14:39:46 *** EditNewslineArchiveAction.prepareModel() - after super call
    07/05/07 14:39:46 *** EditApplicantAction.onSubmmit() ***
    07/05/07 14:39:46 Current Row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000303A487780000000C000001126844BC10
    07/05/07 14:39:46 *** EditNewslineArchiveAction.findForward() - before super call
    07/05/07 14:39:46 *** EditNewslineArchiveAction.findForward() - after super call
    07/05/07 14:39:48 *** EditNewslineArchiveAction.prepareModel() - before super call
    07/05/07 14:39:48 *** EditNewslineArchiveAction.prepareModel() - after super call
    07/05/07 14:39:48 *** EditApplicantAction.onSave() ***
    07/05/07 14:39:48 Current Row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000303A487780000000C000001126844BC10
    07/05/07 14:39:48 masterId = 238727
    07/05/07 14:39:48 displayName = test
    07/05/07 14:39:48 *** NewslineArchiveServceImpl.updateNewslineArchiveItem(String masterId, String displayName) ***
    07/05/07 14:39:48 *** EditNewslineArchiveAction.findForward() - before super call
    07/05/07 14:39:48 *** EditNewslineArchiveAction.findForward() - after super call
    07/05/07 14:39:48 EditApplicantAction.prepareModel() - No events
    07/05/07 14:39:49 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA897800000016000001126844BC10
    07/05/07 14:39:49 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000303A4877800000017000001126844BC10
    07/05/07 14:39:49 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA6F7800000018000001126844BC10
    07/05/07 14:39:49 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA717800000019000001126844BC10
    07/05/07 14:39:49 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA73780000001A000001126844BC10
    07/05/07 14:39:49 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA75780000001B000001126844BC10
    07/05/07 14:39:49 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA77780000001C000001126844BC10
    07/05/07 14:39:49 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA79780000001D000001126844BC10
    07/05/07 14:39:49 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA7D780000001E000001126844BC10
    07/05/07 14:39:49 row.key = 000100000124ACED0005737200146A6176612E6D6174682E426967446563696D616C54C71557F981284F0200024900057363616C654C0006696E7456616C7400164C6A6176612F6D6174682F426967496E74656765723B787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787000000000737200146A6176612E6D6174682E426967496E74656765728CFC9F1FA93BFB1D030006490008626974436F756E744900096269744C656E67746849001366697273744E6F6E7A65726F427974654E756D49000C6C6F776573745365744269744900067369676E756D5B00096D61676E69747564657400025B427871007E0002FFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFE00000001757200025B42ACF317F8060854E002000078700000000302EA83780000001F000001126844BC10
    07/05/07 14:39:49 getQueryHitCount returns the value: 12
    Any help or direction to find an answer would be greatly appreciated!
    Thanks, Ken

    More information -
    ==> Select Edit on Row in table - Primarykey=238727
    07/05/08 10:15:51 *** ShowNewslineArchiveAction.findForward() ***
    May 8, 2007 10:15:51 AM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
    May 8, 2007 10:15:51 AM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
    07/05/08 10:15:51 getQueryHitCount returns the value: 12
    07/05/08 10:15:54 ShowNewslineArchiveAction.prepareModel() - has events
    07/05/08 10:15:54 *** ShowNewslineArchiveAction.findForward() ***
    07/05/08 10:15:54 ShowNewslineArchiveAction.findForward()- event : setCurrentRowWithKey
    07/05/08 10:15:54 ShowNewslineArchiveAction.findForward()- event : Edit
    Forward "Edit" points to this page
    07/05/08 10:15:54 *** EditNewslineArchiveAction.prepareModel() - before super call
    07/05/08 10:15:54 *** EditNewslineArchiveAction.prepareModel() - after super call
    07/05/08 10:15:54 *** EditNewslineArchiveAction.findForward() ***
    07/05/08 10:15:54 Key.getAttribute(0) = 238727
    07/05/08 10:15:54 *** EditNewslineArchiveAction.findForward() - before super call
    07/05/08 10:15:54 *** EditNewslineArchiveAction.findForward() - after super call
    May 8, 2007 10:15:54 AM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
    ==> Set value in displayname field to another value, press submit button - no processing in onSubmit()
    07/05/08 10:15:59 *** EditNewslineArchiveAction.prepareModel() - before super call
    07/05/08 10:15:59 *** EditNewslineArchiveAction.prepareModel() - after super call
    07/05/08 10:16:00 Key.getAttribute(0) = 191113
    oracle.jbo.RowNotFoundException: JBO-25020: View row of key oracle.jbo.Key[238727 ] not found in SearchRefCursor1.
    at oracle.jbo.server.remote.RuntimeViewRowSetIteratorInfo.getRowFromKey(RuntimeViewRowSetIteratorInfo.java:505)
    07/05/08 10:16:00 *** EditNewslineArchiveAction.findForward() ***
    07/05/08 10:16:00 EditNewslineArchiveAction.findForward()- event : Submit
    07/05/08 10:16:00 *** EditNewslineArchiveAction.findForward() - before super call
    07/05/08 10:16:00 *** EditNewslineArchiveAction.findForward() - after super call
    At this point See error message with RowNotFoundException. Don't understand where key was changed from 238727 to 191113 (first record in recordset.)
    ==> Press submit again - works how it should have from start
    07/05/08 10:16:01 *** EditNewslineArchiveAction.prepareModel() - before super call
    07/05/08 10:16:01 *** EditNewslineArchiveAction.prepareModel() - after super call
    07/05/08 10:16:01 *** EditApplicantAction.onSubmmit() ***
    07/05/08 10:16:01 Key.getAttribute(0) = 238727
    07/05/08 10:16:01 *** EditNewslineArchiveAction.findForward() ***
    07/05/08 10:16:01 EditNewslineArchiveAction.findForward()- event : Submit
    07/05/08 10:16:01 *** EditNewslineArchiveAction.findForward() - before super call
    07/05/08 10:16:01 *** EditNewslineArchiveAction.findForward() - after super call
    I looked at section" 7.9 Summary of Difference Between Entity-Based View Objects and Read-Only View Objects" in Oracle Applicatin Development Framework Developer's Guide for Forms/4GL Developers. Since I am using a ViewObject based on a REF CURSOR, I added the setManageRowsByKey(true); in the create() method of my ViewObject. This didn't help.
    Any suggestions?
    Thanks, Ken

  • REF Cursor as Job Parameter

    Hi,
    is it possible to use a REF cursor as a parameter for a job? I need jobs created with DBMS_SCHEDULER.create_job to process data which has always the same format but comes from different sources. The job must be generic and thus should not know where the data comes from. The job calls a PL/SQL procdure which takes the REF cursor as a parameter.
    Regards,
    Pat
    Edited by: Gwydion on Jun 16, 2010 7:13 AM

    Gwydion wrote:
    I tried a different way: Instead of a ref cursor, I tried to pass a PL/SQL table containing the data that the job should process. Bad idea in general as this is not very scalable. A PL/SQL "+table+" is nothing table-like at all. The correct term is array or collection. This structure is primitive in that it cannot be indexed or structured like a SQL table. It also resides in "expensive" memory (the PGA/private memory of a server process) - unlike a SQL table data that will reside in the SGA buffer cache when used. The db buffer cache is shared memory - usable by all processes and thus "inexpensive" memory in comparison.
    So passing and processing any largish data structure that way (via PGA memory) is inherently an unscalable approach. Also, this data set needs to persist until the job process kicks off - thus it needs to be stored somewhere. Why store this data again when it is based on table and row table that already exist in the database? Why duplicate the data?
    You also need to consider data concurrency and integrity. By the time that job/scheduler background process kicks off and receives this data set structure to use for processing... the row data that this set was based on may have changed.. or may not even exist anymore.
    For example, let's say that the data set contains a list of invoice numbers that need to be processed. Some of those invoices may have been canceled in the meantime. Or deleted from the system. Whatever invoice numbers this background server process now needs to deal with, can now be invalid.
    You therefore need to carefully consider exactly what issues and requirements you're trying to address with this approach you are attempting. There are numerous problems areas that it needs to deal with.
    Which begs the question - why are you considering this approach? What problem are you trying to address? Why not simply pass the parameters to the job it needs to use to call the procedure that creates the ref cursor? This is a much simpler and elegant solution than to pass the actual data returned by the ref cursor to the job.

  • REF Cursor in Forms 4.5

    I am using forms 4.5. I have a function whcih returns cursor. I would like to store the return values in Forms cursor variable and iterate thru the result set. When I declare TYPE cname IS REF CUROSOR I get compilation error. Is it possible to declare REF CURSOR in forms 4.5 . Help is greatly appreciated

    Thanks. Is there any way I can capture the ref curosr (or resultset) passed from server from the oracle forms. The purpose is to call the function from the forms with a table id which will return a resultset which is the items in the list , which is used to populate list in forms. To have a centralised location for list elements.
    Is there any package on forms which can be used to capture the returned resultset, pl. let me know

  • Dispalying output from a REF CURSOR

    Friends,
    I'm getting my self into indepth pl/sql and need some help from you to clear some basic concepts.
    create table MASTER_TABLE
    street_info varchar2(100),
    property_type varchar2(50) ------- i.e values here would be 'HOME_TABLE' ,'COM_PROP_TABLE' etc
    create table HOME_TABLE
    property_id char(5),
    prop_desc varchar2(100),
    cost varchar2(10),
    location varchar2(100)
    create table COM_PROP_TABLE
    property_id char(5),
    prop_desc varchar2(100),
    cost varchar2(10),
    location varchar2(100)
    I want to use a single procedure to open a weak REF CURSOR variable for the appropriate table based on the street address and display all information from that table.
    Here is what I want to to - execute a stored procedure which accepts 1 'in' paramter and 1 'in out ' parameter.
    IN paramter - accepts street address
    IN OUT paramter - depending on address , if it is related to 'Homes' , it should display all information from the HOME Table, else it will display information from the 'Commerical Property' table.
    create or replace package pack_address_info as
    type v_info_type ref cursor;
    end pack_address_info;
    create or replace procedure schema.sp_home_info(v_add in varchar2,v_show in out v_info_type)
    is
    home_type constant integer :=1;
    commercial_type constant integer :=2;
    cursor show_data_cur is
    select property_type from MASTER TABLE where street_info=v_add;
    var_cursor show_data_cur%rowtype;
    begin
    open show_data_cur;
    fetch show_data_cur into var_cursor;
    close show_data_cur;
    if var_cursor.property_type= HOME_TABLE
    then
    open v_show for
    select * from HOME_TABLE where location=v_add;
    elseif var_cursor.table_name = COM_PROP_TABLE
    then
    open v_show for
    select * from COM_PROP_TABLE where location=v_add;
    end if;
    end schema.sp_home_info;
    I can create the package and the stored proc ... but then ???? i'm stuck ;(
    Now , i don't know how to display the output from the HOME TABLE or the COM_PROP_TABLE depending on what the address is entered? Is this code correct. Can you please help me modify this code so that I can achieve my objective.
    This is an example from the book 'Oracle PL/SQL Programming, 4th Edition' under the 'CURSOR' section - 15.6
    Thanks for the help in advance.

    Here is one sample ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Elapsed: 00:00:00.02
    satyaki>
    satyaki>
    satyaki>CREATE OR REPLACE PACKAGE aaa_sat     
      2  AS       
      3     TYPE crs IS REF CURSOR RETURN emp%ROWTYPE;        
      4     FUNCTION fc_retcur (e_no IN NUMBER)
      5     RETURN crs;
      6  END aaa_sat;
      7  /
    Package created.
    Elapsed: 00:00:01.03
    satyaki>
    satyaki>
    satyaki>CREATE OR REPLACE PACKAGE BODY aaa_sat     
      2  AS       
      3    FUNCTION fc_retcur (e_no IN NUMBER)
      4    RETURN crs       
      5    IS         
      6      l_crs   crs;       
      7    BEGIN         
      8      OPEN l_crs FOR
      9      SELECT * FROM emp           
    10      WHERE empno = e_no;          
    11     
    12      RETURN l_crs;       
    13    END;
    14  END aaa_sat;
    15  /
    Package body created.
    Elapsed: 00:00:00.18
    satyaki>
    satyaki>
    satyaki>DECLARE       
      2    l_emp_rec   emp%ROWTYPE;       
      3    l_crs       aaa_sat.crs;     
      4  BEGIN       
      5    l_crs := aaa_sat.fc_retcur (7782);        
      6    LOOP          
      7      FETCH l_crs           
      8      INTO l_emp_rec;           
      9        EXIT WHEN l_crs%NOTFOUND;          
    10          DBMS_OUTPUT.put_line (l_emp_rec.ename);     
    11    END LOOP;        
    12    CLOSE l_crs;    
    13  END;
    14  /
    CLARK
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.40
    satyaki>
    satyaki>Got Me?
    Regards.
    Satyaki De.

  • Using a ref cursor

    I have a function that I created and am trying to use it to output data using a ref cursor. My function call is
    declare
    ret_cursor crsiweb.types.cursorType;
    type output_rec_type is record(
    location varchar2(100),
    client varchar2(100),
    number_in long,
    number_out long,
    total_cost varchar2(100),
    total_charge varchar2(100),
    net varchar2(100),
    average varchar2(100)
    output output_rec_type;
    begin
    ret_cursor := all_db.net_profit.net_profit(to_date(:P1_Date_Chart,'DD-Mon-RR'));
    fetch ret_cursor into output;
    dbms_output.put_line('Location' || ',' || 'Company'|| ',' || 'In' ||
    ','|| 'Out'|| ',' || 'Cost'|| ',' || 'Charge'
    || ',' || 'Net' || ',' || '30 Day Average');
    while ret_cursor%FOUND loop
    dbms_output.put_line(output.location || ',' || output.client || ',' || output.number_in ||
    ','|| output.number_out || ',' || output.total_cost || ',' || output.total_charge
    || ',' || output.net || ',' || output.average);
    fetch ret_cursor into output;
    end loop;
    close ret_cursor;
    end;
    i have it as a PL/SQL Procedure (anonymous block) in a region. When executed I get the following error:
    "ORA-06550: line 15, column 25: PLS-00904: insufficient privilege to access object ALL_DB.NET_PROFIT ORA-06550: line 15, column 4: PL/SQL: Statement ignored"
    The function is as follows: ( I created the function in OEM)
    create or replace procedure all_db.net_profit.net_profit
    as
    function net_profit(sdate IN date) return crsiweb.types.cursortype as
    ret_cursor crsiweb.types.cursortype;
    begin
    open ret_cursor for select 'a_chase' "Location",a."Client" "Client", sum(nvl(b."In",0)) "In", sum(nvl(a."Out",0)) "Out", to_char(sum(nvl(a."Cost",0)
    + nvl(b."Cost",0)),'FM$9999999990.00PR') "Cost",
    to_char(sum(nvl(a."Charge",0) + nvl(b."Charge",0)),'FM$9999999990.00PR') "Charge", to_char(sum(nvl(a."Net",0)
    + nvl(b."Net",0)),'FM$9999999990.00PR') "Net",
    to_char(sum(nvl("Average",0)),'FM$9999999990.00PR') "30 Day Average"
    -- Get Out, Cost, Net by date_out
    from (select client_name "Client", count(date_sent) "Out",
    round(sum(nvl(product_cost,0) + nvl(acost1,0) + nvl(acost2,0) + nvl(acost3,0) +
    nvl(acost4,0) + nvl(acost5,0) + nvl(acost6,0) + nvl(acost7,0)
    + nvl(acost8,0) + nvl(acost9,0) + nvl(acost10,0)),2)"Cost",
    round(sum(nvl(product_fee,0) + nvl(copy_fee,0) + nvl(afee1,0) + nvl(afee2,0)+ nvl(afee3,0)
    + nvl(afee4,0)+ nvl(afee5,0)+ nvl(afee6,0)+ nvl(afee7,0)+ nvl(afee1,8)+ nvl(afee1,9)
    + nvl(afee1,10)),2) "Charge",
    round(sum((nvl(product_fee,0) + nvl(copy_fee,0) + nvl(afee1,0) + nvl(afee2,0)+ nvl(afee3,0)
    + nvl(afee4,0)+ nvl(afee5,0)+ nvl(afee6,0)+ nvl(afee7,0)+ nvl(afee1,8)+ nvl(afee1,9)
    + nvl(afee1,10)) - (nvl(product_cost,0) + nvl(acost1,0) + nvl(acost2,0) + nvl(acost3,0) +
    nvl(acost4,0) + nvl(acost5,0) + nvl(acost6,0) + nvl(acost7,0)
    + nvl(acost8,0) + nvl(acost9,0) + nvl(acost10,0))),2) "Net"
    from a_chase.jim a
    inner join a_chase.clients b
    on a.clientid = b.clientid
    where trunc(date_sent) = trunc(sdate)
    group by client_name) a
    --Get In, Cost, Net by date_In
    left outer join (select client_name "Client", count(date_in) "In",
    round(sum(nvl(product_cost,0) + nvl(acost1,0) + nvl(acost2,0) + nvl(acost3,0) +
    nvl(acost4,0) + nvl(acost5,0) + nvl(acost6,0) + nvl(acost7,0)
    + nvl(acost8,0) + nvl(acost9,0) + nvl(acost10,0)),2)"Cost",
    round(sum(nvl(product_fee,0) + nvl(copy_fee,0) + nvl(afee1,0) + nvl(afee2,0)+ nvl(afee3,0)
    + nvl(afee4,0)+ nvl(afee5,0)+ nvl(afee6,0)+ nvl(afee7,0)+ nvl(afee1,8)+ nvl(afee1,9)
    + nvl(afee1,10)),2) "Charge",
    round(sum((nvl(product_fee,0) + nvl(copy_fee,0) + nvl(afee1,0) + nvl(afee2,0)+ nvl(afee3,0)
    + nvl(afee4,0)+ nvl(afee5,0)+ nvl(afee6,0)+ nvl(afee7,0)+ nvl(afee1,8)+ nvl(afee1,9)
    + nvl(afee1,10)) - (nvl(product_cost,0) + nvl(acost1,0) + nvl(acost2,0) + nvl(acost3,0) +
    nvl(acost4,0) + nvl(acost5,0) + nvl(acost6,0) + nvl(acost7,0)
    + nvl(acost8,0) + nvl(acost9,0) + nvl(acost10,0))),2) "Net"
    from a_chase.jim a
    inner join a_chase.clients b
    on a.clientid = b.clientid
    where trunc(date_in) = trunc(sdate)
    group by client_name) b
    on a."Client" = b."Client"
    -- Get 30 Day Average
    inner join (select client_name, round(avg("Net"),2) "Average" from
    (select trunc(date_in) "In", client_name, round(sum((nvl(product_fee,0) + nvl(copy_fee,0) + nvl(afee1,0) + nvl(afee2,0)+ nvl(afee3,0)
    + nvl(afee4,0)+ nvl(afee5,0)+ nvl(afee6,0)+ nvl(afee7,0)+ nvl(afee1,8)+ nvl(afee1,9)
    + nvl(afee1,10)) - (nvl(product_cost,0) + nvl(acost1,0) + nvl(acost2,0) + nvl(acost3,0) +
    nvl(acost4,0) + nvl(acost5,0) + nvl(acost6,0) + nvl(acost7,0)
    + nvl(acost8,0) + nvl(acost9,0) + nvl(acost10,0))),2) "Net"
    from a_chase.jim a
    inner join a_chase.clients b
    on a.clientid = b.clientid
    where trunc(date_in) between (trunc(sdate) - 30) and trunc(sdate)
    group by trunc(date_in), client_name)
    group by client_name) c
    on a."Client" = c.client_name
    group by a."Client"
    union --BU_TS
    select 'bu_ts' "Location",a."Client" "Client", sum(nvl(b."In",0)) "In", sum(nvl(a."Out",0)) "Out", to_char(sum(nvl(a."Cost",0)
    + nvl(b."Cost",0)),'FM$9999999990.00PR') "Cost",
    to_char(sum(nvl(a."Charge",0) + nvl(b."Charge",0)),'FM$9999999990.00PR') "Charge", to_char(sum(nvl(a."Net",0)
    + nvl(b."Net",0)),'FM$9999999990.00PR') "Net",
    to_char(sum(nvl("Average",0)),'FM$9999999990.00PR') "30 Day Average"
    -- Get Out, Cost, Net by date_out
    from (select client_name "Client", count(date_sent) "Out",
    round(sum(nvl(product_cost,0) + nvl(acost1,0) + nvl(acost2,0) + nvl(acost3,0) +
    nvl(acost4,0) + nvl(acost5,0) + nvl(acost6,0) + nvl(acost7,0)
    + nvl(acost8,0) + nvl(acost9,0) + nvl(acost10,0)),2)"Cost",
    round(sum(nvl(product_fee,0) + nvl(copy_fee,0) + nvl(afee1,0) + nvl(afee2,0)+ nvl(afee3,0)
    + nvl(afee4,0)+ nvl(afee5,0)+ nvl(afee6,0)+ nvl(afee7,0)+ nvl(afee1,8)+ nvl(afee1,9)
    + nvl(afee1,10)),2) "Charge",
    round(sum((nvl(product_fee,0) + nvl(copy_fee,0) + nvl(afee1,0) + nvl(afee2,0)+ nvl(afee3,0)
    + nvl(afee4,0)+ nvl(afee5,0)+ nvl(afee6,0)+ nvl(afee7,0)+ nvl(afee1,8)+ nvl(afee1,9)
    + nvl(afee1,10)) - (nvl(product_cost,0) + nvl(acost1,0) + nvl(acost2,0) + nvl(acost3,0) +
    nvl(acost4,0) + nvl(acost5,0) + nvl(acost6,0) + nvl(acost7,0)
    + nvl(acost8,0) + nvl(acost9,0) + nvl(acost10,0))),2) "Net"
    from bu_ts.jim a
    inner join bu_ts.clients b
    on a.clientid = b.clientid
    where trunc(date_sent) = trunc(sdate)
    group by client_name) a
    --Get In, Cost, Net by date_In
    left outer join (select client_name "Client", count(date_in) "In",
    round(sum(nvl(product_cost,0) + nvl(acost1,0) + nvl(acost2,0) + nvl(acost3,0) +
    nvl(acost4,0) + nvl(acost5,0) + nvl(acost6,0) + nvl(acost7,0)
    + nvl(acost8,0) + nvl(acost9,0) + nvl(acost10,0)),2)"Cost",
    round(sum(nvl(product_fee,0) + nvl(copy_fee,0) + nvl(afee1,0) + nvl(afee2,0)+ nvl(afee3,0)
    + nvl(afee4,0)+ nvl(afee5,0)+ nvl(afee6,0)+ nvl(afee7,0)+ nvl(afee1,8)+ nvl(afee1,9)
    + nvl(afee1,10)),2) "Charge",
    round(sum((nvl(product_fee,0) + nvl(copy_fee,0) + nvl(afee1,0) + nvl(afee2,0)+ nvl(afee3,0)
    + nvl(afee4,0)+ nvl(afee5,0)+ nvl(afee6,0)+ nvl(afee7,0)+ nvl(afee1,8)+ nvl(afee1,9)
    + nvl(afee1,10)) - (nvl(product_cost,0) + nvl(acost1,0) + nvl(acost2,0) + nvl(acost3,0) +
    nvl(acost4,0) + nvl(acost5,0) + nvl(acost6,0) + nvl(acost7,0)
    + nvl(acost8,0) + nvl(acost9,0) + nvl(acost10,0))),2) "Net"
    from bu_ts.jim a
    inner join bu_ts.clients b
    on a.clientid = b.clientid
    where trunc(date_in) = trunc(sdate)
    group by client_name) b
    on a."Client" = b."Client"
    -- Get 30 Day Average
    inner join (select client_name, round(avg("Net"),2) "Average" from
    (select trunc(date_in) "In", client_name, round(sum((nvl(product_fee,0) + nvl(copy_fee,0) + nvl(afee1,0) + nvl(afee2,0)+ nvl(afee3,0)
    + nvl(afee4,0)+ nvl(afee5,0)+ nvl(afee6,0)+ nvl(afee7,0)+ nvl(afee1,8)+ nvl(afee1,9)
    + nvl(afee1,10)) - (nvl(product_cost,0) + nvl(acost1,0) + nvl(acost2,0) + nvl(acost3,0) +
    nvl(acost4,0) + nvl(acost5,0) + nvl(acost6,0) + nvl(acost7,0)
    + nvl(acost8,0) + nvl(acost9,0) + nvl(acost10,0))),2) "Net"
    from bu_ts.jim a
    inner join bu_ts.clients b
    on a.clientid = b.clientid
    where trunc(date_in) between (trunc(sdate) - 30) and trunc(sdate)
    group by trunc(date_in), client_name)
    group by client_name) c
    on a."Client" = c.client_name
    group by a."Client"
    union --BU
    select 'BU' "Location", a."Company" "Client", sum(nvl(b."In",0)) "In", sum(nvl(a."Out",0)) "Out", to_char(sum(nvl(a."Cost",0)
    + nvl(b."Cost",0)),'FM$9999999990.00PR') "Cost",
    to_char(sum(nvl(a."Charge", 0) + nvl(b."Charge",0)),'FM$9999999990.00PR') "Charge", to_char(sum(nvl(a."Net",0)
    + nvl(b."Net",0)),'FM$9999999990.00PR') "Net",
    to_char(sum(nvl("Average",0)),'FM$9999999990.00PR') "30 Day Average"
    from
    (--Out Query
    select b.clcompanyname "Company", count(*) "Out",
    round(sum(nvl(cost1,0) + nvl(cost2,0) + nvl(cost3,0) + nvl(cost4,0) + nvl(cost5,0) + nvl(costx1,0)
    + nvl(costx2,0)+ nvl(costx3,0)+ nvl(costx4,0)+ nvl(costx5,0)+ nvl(costy1,0)+ nvl(costy2,0)+ nvl(costy3,0)
    + nvl(costy4,0)+ nvl(costy5,0)),2) "Cost",
    round(sum(nvl(fee1,0) + nvl(fee2,0) + nvl(fee3,0) + nvl(fee4,0) + nvl(fee5,0) + nvl(feex1,0)
    + nvl(feex2,0)+ nvl(feex3,0)+ nvl(feex4,0)+ nvl(feex5,0)+ nvl(feey1,0)+ nvl(feey2,0)+ nvl(feey3,0)
    + nvl(feey4,0)+ nvl(feey5,0)),2) "Charge",
    round( sum(nvl(fee1,0) + nvl(fee2,0) + nvl(fee3,0) + nvl(fee4,0) + nvl(fee5,0) + nvl(feex1,0)
    + nvl(feex2,0)+ nvl(feex3,0)+ nvl(feex4,0)+ nvl(feex5,0)+ nvl(feey1,0)+ nvl(feey2,0)+ nvl(feey3,0)
    + nvl(feey4,0)+ nvl(feey5,0) - nvl(cost1,0) - nvl(cost2,0) - nvl(cost3,0) - nvl(cost4,0) - nvl(cost5,0) - nvl(costx1,0)
    - nvl(costx2,0)- nvl(costx3,0)- nvl(costx4,0)- nvl(costx5,0)- nvl(costy1,0)- nvl(costy2,0)- nvl(costy3,0)
    - nvl(costy4,0)- nvl(costy5,0)),2) "Net"
    from [email protected] a
    inner join [email protected] b
    on a.clientid = b.clientid
    where trunc(compdate1) = trunc(sdate)
    or trunc(compdate2) = trunc(sdate)
    or trunc(compdate3) = trunc(sdate)
    or trunc(compdate4) = trunc(sdate)
    or trunc(compdate5) = trunc(sdate)
    group by b.clcompanyname) a
    --in Query
    left outer join (select b.clcompanyname "Company", count(a.loandatein) "In",
    round(sum(nvl(cost1,0) + nvl(cost2,0) + nvl(cost3,0) + nvl(cost4,0) + nvl(cost5,0) + nvl(costx1,0)
    + nvl(costx2,0)+ nvl(costx3,0)+ nvl(costx4,0)+ nvl(costx5,0)+ nvl(costy1,0)+ nvl(costy2,0)+ nvl(costy3,0)
    + nvl(costy4,0)+ nvl(costy5,0)),2) "Cost",
    round(sum(nvl(fee1,0) + nvl(fee2,0) + nvl(fee3,0) + nvl(fee4,0) + nvl(fee5,0) + nvl(feex1,0)
    + nvl(feex2,0)+ nvl(feex3,0)+ nvl(feex4,0)+ nvl(feex5,0)+ nvl(feey1,0)+ nvl(feey2,0)+ nvl(feey3,0)
    + nvl(feey4,0)+ nvl(feey5,0)),2) "Charge",
    round( sum(nvl(fee1,0) + nvl(fee2,0) + nvl(fee3,0) + nvl(fee4,0) + nvl(fee5,0) + nvl(feex1,0)
    + nvl(feex2,0)+ nvl(feex3,0)+ nvl(feex4,0)+ nvl(feex5,0)+ nvl(feey1,0)+ nvl(feey2,0)+ nvl(feey3,0)
    + nvl(feey4,0)+ nvl(feey5,0) - nvl(cost1,0) - nvl(cost2,0) - nvl(cost3,0) - nvl(cost4,0) - nvl(cost5,0) - nvl(costx1,0)
    - nvl(costx2,0)- nvl(costx3,0)- nvl(costx4,0)- nvl(costx5,0)- nvl(costy1,0)- nvl(costy2,0)- nvl(costy3,0)
    - nvl(costy4,0)- nvl(costy5,0)),2) "Net"
    from [email protected] a
    inner join [email protected] b
    on a.clientid = b.clientid
    where trunc(a.loandatein) = trunc(sdate)
    group by b.clcompanyname) b
    on a."Company" = b."Company"
    --Avg Query
    inner join (select "Company", round(avg("Net"),2) "Average" from
    (select trunc(loandatein) "In", b.clcompanyname "Company",
    round( sum(nvl(fee1,0) + nvl(fee2,0) + nvl(fee3,0) + nvl(fee4,0) + nvl(fee5,0) + nvl(feex1,0)
    + nvl(feex2,0)+ nvl(feex3,0)+ nvl(feex4,0)+ nvl(feex5,0)+ nvl(feey1,0)+ nvl(feey2,0)+ nvl(feey3,0)
    + nvl(feey4,0)+ nvl(feey5,0) - nvl(cost1,0) - nvl(cost2,0) - nvl(cost3,0) - nvl(cost4,0) - nvl(cost5,0) - nvl(costx1,0)
    - nvl(costx2,0)- nvl(costx3,0)- nvl(costx4,0)- nvl(costx5,0)- nvl(costy1,0)- nvl(costy2,0)- nvl(costy3,0)
    - nvl(costy4,0)- nvl(costy5,0)),2) "Net"
    from [email protected] a
    inner join [email protected] b
    on a.clientid = b.clientid
    where trunc(loandatein) between (trunc(sdate) - 30) and trunc(sdate)
    group by trunc(loandatein), b.clcompanyname)
    group by "Company") c
    on a."Company" = c."Company"
    group by a."Company";
    return(ret_cursor);
    end;
    end;
    I also have given htmldb_public_user grant/execute privileges on this function. Any help would be greatly appreciated.
    Thanks,
    Scott

    thanks, lalit. that's almost correct. htmldb_public_user is the username through which the mod_plsql DAD connects to the database. he has just the privs he needs to serve that function. the htmldb engine compiles into a FLOWS_010500 schema in the production release. having said that, lalit's suggestion is correct. you need to make sure your htmldb application schema (identified by the application-level attribute "Default Parsing Schema") has been directly granted privileges (directly as opposed to coming through a role rant) to run the objects it's calling.
    hope this helps,
    raj

  • Using Ref Cursor in procedure in place of normal cursor

    Hi,
    I have a procedure where i have the follwoing cursors declared,
    CURSOR c_wip IS
    SELECT tdvalue
    FROM tabledetails
    WHERE tdidcode = 'PEL_DASHBOARD'
    AND tdkey LIKE 'WIP_QUEUES%';
    CURSOR c_pending IS
    SELECT tdvalue
    FROM tabledetails
    WHERE tdidcode = 'PEL_DASHBOARD'
    AND tdkey LIKE 'PENDING_QUEUES%';
    CURSOR c_out IS
    SELECT tdvalue
    FROM tabledetails
    WHERE tdidcode = 'PEL_DASHBOARD'
    AND tdkey LIKE 'OUT_QUEUES%';
    CURSOR c_out_status IS
    SELECT tdvalue
    FROM tabledetails
    WHERE tdidcode = 'PEL_DASHBOARD'
    AND tdkey LIKE 'OUT_STATUS%';
    Will the usage of 1 ref cursor instead of the 4 cursors increase the performance.
    Thanks.

    Cursor is a structure which points to a memory locations.
    While a Ref-cursor is a datastructure which point to a object which inturn points to Memory locations.
    The advantage of having Ref-cursor is that we can pass dynamically the Ref-cursor as a parameter to a procedures.
    So it does improve the performance to a small extent.

  • Want to manipulate the ref cursor

    Hi,
    iam having a procedure whiuch returns a ref cursor as a output parameter having 20 columns.
    i had to manipulate only 2 columns in that ref cursor output in another calling procedure.
    iam getting an error when iam fetching the ref cursor result into only 2 variables.
    How can i achieve this ?

    Why?
    Let's see it ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Elapsed: 00:00:00.18
    satyaki>
    satyaki>create or replace procedure r_gen_arg(
      2                                         choice in number,
      3                                         b in out sys_refcursor
      4                                       )
      5  is  
      6    str   varchar2(500);
      7  begin   
      8    if choice = 1 then      
      9        str := 'select * from emp';   
    10    elsif choice = 2 then      
    11      str := 'select * from dept';   
    12    end if;       
    13   
    14    open b for str;
    15  exception  
    16    when others then     
    17      dbms_output.put_line(sqlerrm);
    18  end;
    19  /
    Procedure created.
    Elapsed: 00:00:04.51
    satyaki>
    satyaki>
    satyaki>declare   
      2    rec_x emp%rowtype;   
      3    rec_y dept%rowtype;       
      4    w sys_refcursor;
      5  begin  
      6    dbms_output.enable(1000000);  
      7    r_gen_arg(1,w);  
      8    loop    
      9      fetch w into rec_x;     
    10        exit when w%notfound;             
    11        dbms_output.put_line('Employee No: '||rec_x.empno||' - '||                          
    12                             'Name: '||rec_x.ename||' - '||                          
    13                             'Job: '||rec_x.job||' - '||                          
    14                             'Manager: '||rec_x.mgr||' - '||                          
    15                             'Joining Date: '||rec_x.hiredate||' - '||                          
    16                             'Salary: '||rec_x.sal||' - '||                          
    17                             'Commission: '||rec_x.comm||' - '||                          
    18                             'Department No: '||rec_x.deptno);  
    19     end loop;  
    20     close w;    
    21    
    22     r_gen_arg(2,w);  
    23     loop    
    24       fetch w into rec_y;
    25        exit when w%notfound;            
    26        dbms_output.put_line('Department No: '||rec_y.deptno||' - '||                           
    27                             'Name: '||rec_y.dname||' - '||                           
    28                             'Location: '||rec_y.loc);  
    29     end loop;  
    30     close w;
    31  exception  
    32    when others then    
    33       dbms_output.put_line(sqlerrm);
    34  end;
    35  /
    Employee No: 9999 - Name: SATYAKI - Job: SLS - Manager: 7698 - Joining Date: 02-NOV-08 - Salary: 55000 - Commission: 3455 - Department No: 10
    Employee No: 7777 - Name: SOURAV - Job: SLS - Manager:  - Joining Date: 14-SEP-08 - Salary: 45000 - Commission: 3400 - Department No: 10
    Employee No: 7521 - Name: WARD - Job: SALESMAN - Manager: 7698 - Joining Date: 22-FEB-81 - Salary: 1250 - Commission: 500 - Department No: 30
    Employee No: 7566 - Name: JONES - Job: MANAGER - Manager: 7839 - Joining Date: 02-APR-81 - Salary: 2975 - Commission:  - Department No: 20
    Employee No: 7654 - Name: MARTIN - Job: SALESMAN - Manager: 7698 - Joining Date: 28-SEP-81 - Salary: 1250 - Commission: 1400 - Department No: 30
    Employee No: 7698 - Name: BLAKE - Job: MANAGER - Manager: 7839 - Joining Date: 01-MAY-81 - Salary: 2850 - Commission:  - Department No: 30
    Employee No: 7782 - Name: CLARK - Job: MANAGER - Manager: 7839 - Joining Date: 09-JUN-81 - Salary: 4450 - Commission:  - Department No: 10
    Employee No: 7788 - Name: SCOTT - Job: ANALYST - Manager: 7566 - Joining Date: 19-APR-87 - Salary: 3000 - Commission:  - Department No: 20
    Employee No: 7839 - Name: KING - Job: PRESIDENT - Manager:  - Joining Date: 17-NOV-81 - Salary: 7000 - Commission:  - Department No: 10
    Employee No: 7844 - Name: TURNER - Job: SALESMAN - Manager: 7698 - Joining Date: 08-SEP-81 - Salary: 1500 - Commission: 0 - Department No: 30
    Employee No: 7876 - Name: ADAMS - Job: CLERK - Manager: 7788 - Joining Date: 23-MAY-87 - Salary: 1100 - Commission:  - Department No: 20
    Employee No: 7900 - Name: JAMES - Job: CLERK - Manager: 7698 - Joining Date: 03-DEC-81 - Salary: 950 - Commission:  - Department No: 30
    Employee No: 7902 - Name: FORD - Job: ANALYST - Manager: 7566 - Joining Date: 03-DEC-81 - Salary: 3000 - Commission:  - Department No: 20
    Department No: 10 - Name: ACCOUNTING - Location: NEW YORK
    Department No: 20 - Name: RESEARCH - Location: DALLAS
    Department No: 30 - Name: SALES - Location: CHICAGO
    Department No: 40 - Name: LOGISTICS - Location: CHICAGO
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.85
    satyaki>
    satyaki>Here, i don't have to use separate variable to hold those required value.
    Regards.
    Satyaki De.

  • TYPE REF CURSOR

    I have two packages (please see below). A procedure from the first package (TEST1) calls a procedure in the second package (TEST2), which has an output parameter of REF CURSOR TYPE.
    I am getting an error at compile time, in the calling procedure.
    Can anyone please help on finding out what am I missing here?
    Thank you in advance.
    - Ketan Bhuptani
    Here are the procedures:
    (1)
    CREATE OR REPLACE PACKAGE TEST1
    AS
    TYPE cursor_type_pass IS REF CURSOR;
    PROCEDURE call_cursor (result_flag OUT varchar2);
    END TEST1;
    CREATE OR REPLACE PACKAGE BODY TEST1
    AS
    PROCEDURE call_cursor (result_flag OUT varchar2) IS
    v_salary int;
    proc_cursor cursor_type_pass;
    CURSOR emp_cur is select empid from emp;
    BEGIN
    FOR emp_cur_var IN emp_cur
    LOOP
    test2.open_cursor(emp_cur_var.empid, proc_cursor);
    v_salary := proc_cursor.salary;
         -- getting an error Invalid reference to variable proc_cursor at this line
    END LOOP;
    END call_cursor;
    END TEST1;
    (2)
    CREATE OR REPLACE PACKAGE TEST2
    AS
    TYPE cursor_type_return IS REF CURSOR;
    PROCEDURE open_cursor (emp_id IN varchar2, out_cur OUT cursor_type_return);
    END TEST2;
    CREATE OR REPLACE PACKAGE BODY TEST2
    AS
    PROCEDURE open_cursor (emp_id IN varchar2, out_cur OUT cursor_type_return) IS
    BEGIN
    OPEN out_cur FOR
    select location, salary from emp_information where empid = emp_id;
    END open_cursor;
    END TEST2;
    create table emp_information
    (location varchar2(30), salary int, empid varchar2(10));
    create table emp
    (empid varchar2(10));

    Your scenario is not very clear to me, but let us do some test coding here, see if it helps you,SQL> create or replace package test_pkg1 as
      2  TYPE cursor_type1 IS REF CURSOR;
      3  procedure proc1;
      4  end;
      5  /
    Package created.
    SQL> create or replace package test_pkg2 as
      2  TYPE cursor_type2 IS REF CURSOR;
      3  procedure proc2(pCur IN OUT cursor_type2);
      4  end;
      5  /
    Package created.
    SQL> create or replace package body test_pkg2 as
      2  procedure proc2(pCur IN OUT cursor_type2) is
      3  begin
      4      open pCur for SELECT ename from  my_emp;
      5  end;
      6  end;
      7  /
    Package body created.
    SQL> create or replace package body test_pkg1 as
      2  procedure proc1 is
      3  vRefCur    cursor_type1;
      4  vEname     VARCHAR2(20);
      5  vRefCur2   test_pkg2.cursor_type2;
      6  begin
      7    test_pkg2.proc2(vRefCur); -- this is possible, but I do not like it.
      8    vRefCur2 := vRefCur; -- you can also do this, but you have no reason to do this
      9    loop
    10      fetch vRefCur2 into vEname;
    11      exit when vRefCur2%NOTFOUND;
    12      dbms_output.put_line(vEname);
    13    end loop;
    14    close vRefCur2;
    15  end;
    16  end;
    17  /
    Package body created.
    SQL> exec test_pkg1.proc1;
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    KING
    TURNER
    ADAMS
    JAMES
    FORD
    MILLER
    PL/SQL procedure successfully completed.
    Let us make it simple,
    SQL> create or replace package body test_pkg1 as
      2  procedure proc1 is
      3  vRefCur    cursor_type1;
      4  vEname     VARCHAR2(20);
      5  --vRefCur2   test_pkg2.cursor_type2;
      6  begin
      7    test_pkg2.proc2(vRefCur);
      8    --vRefCur2 := vRefCur;
      9    loop
    10      fetch vRefCur into vEname;
    11      exit when vRefCur%NOTFOUND;
    12      dbms_output.put_line(vEname);
    13    end loop;
    14    close vRefCur;
    15  end;
    16  end;
    17  /
    Package body created.
    SQL> exec test_pkg1.proc1;
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    KING
    TURNER
    ADAMS
    JAMES
    FORD
    MILLER
    PL/SQL procedure successfully completed.You can play with it number of different ways.
    Let me know what questions and we will take it from there.
    Thx,
    SriDHAR

  • Odd error while opening a ref cursor

    Hi.
    I have a procedure in a package that has both in and out parameters. One of those out parameters is a ref cursor. The procedure creates a dynamic query and then executes it, then it opens the cursor:
    PROCEDURE PROC(
    A IN VARCHAR2,
    B IN VARCHAR2,
    C OUT TYPES.cursorType; --(TYPES is a package whose only use is to declare a cursor type)
    ) IS
    --DECLARATIONS
    OPEN C FOR 'SELECT A, B, C, D...';
    END;
    When I execute the package in an anonymous block it throws the error:
    ORA-00938: not enough arguments for function, just in the line where the cursor is being opened.
    Any ideas?

    is everything defined correctly?
    create or replace package types  as
      type cursorType is ref cursor;
    end types;
    SQL> set serveroutput on
    SQL> declare
      2 
      3    ref_C types.cursorType;
      4   
      5    v_a varchar2(1);
      6    v_b varchar2(1);
      7    v_c varchar2(1);
      8    v_d varchar2(1);
      9   
    10    procedure Proc (a in varchar2
    11                   ,b in varchar2
    12                   ,C out types.cursorType) as
    13 
    14      begin
    15        open C for 'select :1, :2, ''c'', ''d'' from dual' using a, b;
    16    end  Proc;
    17  begin
    18 
    19 
    20    Proc('a', 'b', ref_C);
    21   
    22    fetch ref_C into v_a, v_b, v_c, v_d;
    23    if (ref_C%found) then
    24      dbms_output.put_line(v_a);
    25      dbms_output.put_line(v_b);
    26      dbms_output.put_line(v_c);
    27      dbms_output.put_line(v_d);
    28    end if;
    29   
    30   
    31  end;
    32  /
    a
    b
    c
    dP;
    Edited by: bluefrog on Feb 18, 2010 6:07 PM

  • Ref Cursor and For Loop

    The query below will return values in the form of
    bu     seq     eligible
    22     2345     Y
    22     2345     N
    22     1288     N
    22     1458     Y
    22     1458     N
    22     1234     Y
    22     1333     N
    What I am trying to accomplish is to loop through the records returned.
    for each seq if there is a 'N' in the eligible column return no record for that seq
    eg seq 2345 has 'Y' and 'N' thus no record should be returned.
    seq 1234 has only a 'Y' then return the record
    seq 1333 has 'N' so return no record.
    How would I accomplish this with a ref Cursor and pass the values to the front end application.
    Procedure InvalidNOs(io_CURSOR OUT T_CURSOR)
         IS
              v_CURSOR T_CURSOR;
         BEGIN
    OPEN v_CURSOR FOR
    '     select bu, seq, eligible ' ||
    '     from (select bu, seq, po, tunit, tdollar,eligible,max(eligible) over () re ' ||
    '          from (select bu, seq, po, tunit, tdollar,eligible ' ||
    '          from ( ' ||
    '          select bu, seq, po, tunit, tdollar, eligible, sum(qty) qty, sum(price*qty) dollars ' ||
    '               from ' ||
    '               ( select /*+ use_nl(t,h,d,s) */ ' ||
    '               h.business_unit_id bu, h.edi_sequence_id seq, d.edi_det_sequ_id dseq, ' ||
    '                    s.edi_size_sequ_id sseq, h.po_number po, h.total_unit tUnit, h.total_amount tDollar, ' ||
    '                    s.quantity qty, s.unit_price price,' ||
    '               (select (case when count(*) = 0 then ''Y'' else ''N'' end) ' ||
    '          from sewn.NT_edii_po_det_error ' ||
    '          where edi_det_sequ_id = d.edi_det_sequ_id ' ||
    '               ) eligible ' ||
    '     from sewn.nt_edii_purchase_size s, sewn.nt_edii_purchase_det d, ' ||
    '     sewn.nt_edii_purchase_hdr h, sewn.nt_edii_param_temp t ' ||
    '     where h.business_unit_id = t.business_unit_id ' ||
    '     and h.edi_sequence_id = t.edi_sequence_id ' ||
    '     and h.business_unit_id = d.business_unit_id ' ||
    '     and h.edi_sequence_id = d.edi_sequence_id ' ||
    '     and d.business_unit_id = s.business_unit_id ' ||
    '     and d.edi_sequence_id = s.edi_sequence_id ' ||
    '     and d.edi_det_sequ_id = s.edi_det_sequ_id ' ||
    '     ) group by bu, seq, po, tunit, tdollar, eligible ' ||
    '     ) ' ||
    '     group by bu, seq, po, tunit, tdollar, eligible)) ';
              io_CURSOR := v_CURSOR;
    END     InvalidNOs;

    One remark why you should not use the assignment between ref cursor
    variables.
    (I remembered I saw already such thing in your code).
    Technically you can do it but it does not make sense and it can confuse your results.
    In the opposite to usual variables, when your assignment copies value
    from one variable to another, cursor variables are pointers to the memory.
    Because of this when you assign one cursor variable to another you just
    duplicate memory pointers. You don't copy result sets. What you do for
    one pointer is that you do for another and vice versa. They are the same.
    I think the below example is self-explained:
    SQL> /* usual variables */
    SQL> declare
      2   a number;
      3   b number;
      4  begin
      5   a := 1;
      6   b := a;
      7   a := a + 1;
      8   dbms_output.put_line('a = ' || a);
      9   dbms_output.put_line('b = ' || b);
    10  end;
    11  /
    a = 2
    b = 1
    PL/SQL procedure successfully completed.
    SQL> /* cursor variables */
    SQL> declare
      2   a sys_refcursor;
      3   b sys_refcursor;
      4  begin
      5   open a for select empno from emp;
      6   b := a;
      7   close b;
      8 
      9   /* next action is impossible - cursor already closed */
    10   /* a and b are the same ! */
    11   close a;
    12  end;
    13  /
    declare
    ERROR at line 1:
    ORA-01001: invalid cursor
    ORA-06512: at line 11
    SQL> declare
      2   a sys_refcursor;
      3   b sys_refcursor;
      4   vempno emp.empno%type;
      5 
      6  begin
      7   open a for select empno from emp;
      8   b := a;
      9 
    10   /* Fetch first row from a */
    11   fetch a into vempno;
    12   dbms_output.put_line(vempno);
    13 
    14   /* Fetch from b gives us SECOND row, not first -
    15      a and b are the SAME */
    16 
    17   fetch b into vempno;
    18   dbms_output.put_line(vempno);
    19 
    20 
    21  end;
    22  /
    7369
    7499
    PL/SQL procedure successfully completed.Rgds.
    Message was edited by:
    dnikiforov

  • Dynamic sql and ref cursors URGENT!!

    Hi,
    I'm using a long to build a dynamic sql statement. This is limited by about 32k. This is too short for my statement.
    The query results in a ref cursor.
    Does anyone have an idea to create larger statement or to couple ref cursors, so I can execute the statement a couple of times and as an result I still have one ref cursor.
    Example:
    /* Determine if project is main project, then select all subprojects */
    for i in isMainProject loop
    if i.belongstoprojectno is null then
    for i in ProjectSubNumbers loop
    if ProjectSubNumbers%rowcount=1 then
    SqlStatement := InitialStatement || i.projectno;
    else
    SqlStatement := SqlStatement || PartialStatement || i.projectno;
    end if;
    end loop;
    else
    for i in ProjectNumber loop
    if ProjectNumber%rowcount=1 then
    SqlStatement := InitialStatement || i.projectno;
    else
    SqlStatement := SqlStatement || PartialStatement || i.projectno;
    end if;
    end loop;
    end if;
    end loop;
    /* Open ref cursor */
    open sql_output for SqlStatement;
    Thanks in advance,
    Jeroen Muis
    KCI Datasystems BV
    mailto:[email protected]

    Example for 'dynamic' ref cursor - dynamic WHERE
    (note that Reports need 'static' ref cursor type
    for building Report Layout):
    1. Stored package
    CREATE OR REPLACE PACKAGE report_dynamic IS
    TYPE type_ref_cur_sta IS REF CURSOR RETURN dept%ROWTYPE; -- for Report Layout only
    TYPE type_ref_cur_dyn IS REF CURSOR;
    FUNCTION func_dyn (p_where VARCHAR2) RETURN type_ref_cur_dyn;
    END;
    CREATE OR REPLACE PACKAGE BODY report_dynamic IS
    FUNCTION func_dyn (p_where VARCHAR2) RETURN type_ref_cur_dyn IS
    ref_cur_dyn type_ref_cur_dyn;
    BEGIN
    OPEN ref_cur_dyn FOR
    'SELECT * FROM dept WHERE ' | | NVL (p_where, '1 = 1');
    RETURN ref_cur_dyn;
    END;
    END;
    2. Query PL/SQL in Reports
    function QR_1RefCurQuery return report_dynamic.type_ref_cur_sta is
    begin
    return report_dynamic.func_dyn (:p_where);
    end;
    Regards
    Zlatko Sirotic
    null

  • ORA-01008 with ref cursor and dynamic sql

    When I run the follwing procedure:
    variable x refcursor
    set autoprint on
    begin
      Crosstab.pivot(p_max_cols => 4,
       p_query => 'select job, count(*) cnt, deptno, row_number() over (partition by job order by deptno) rn from scott.emp group by job, deptno',
       p_anchor => Crosstab.array('JOB'),
       p_pivot  => Crosstab.array('DEPTNO', 'CNT'),
       p_cursor => :x );
    end;I get the following error:
    ^----------------
    Statement Ignored
    set autoprint on
    begin
    adsmgr.Crosstab.pivot(p_max_cols => 4,
    p_query => 'select job, count(*) cnt, deptno, row_number() over (partition by
    p_anchor => adsmgr.Crosstab.array('JOB'),
    p_pivot => adsmgr.Crosstab.array('DEPTNO', 'CNT'),
    p_cursor => :x );
    end;
    ORA-01008: not all variables bound
    I am running this on a stored procedure as follows:
    create or replace package Crosstab
    as
        type refcursor is ref cursor;
        type array is table of varchar2(30);
        procedure pivot( p_max_cols       in number   default null,
                         p_max_cols_query in varchar2 default null,
                         p_query          in varchar2,
                         p_anchor         in array,
                         p_pivot          in array,
                         p_cursor in out refcursor );
    end;
    create or replace package body Crosstab
    as
    procedure pivot( p_max_cols          in number   default null,
                     p_max_cols_query in varchar2 default null,
                     p_query          in varchar2,
                     p_anchor         in array,
                     p_pivot          in array,
                     p_cursor in out refcursor )
    as
        l_max_cols number;
        l_query    long;
        l_cnames   array;
    begin
        -- figure out the number of columns we must support
        -- we either KNOW this or we have a query that can tell us
        if ( p_max_cols is not null )
        then
            l_max_cols := p_max_cols;
        elsif ( p_max_cols_query is not null )
        then
            execute immediate p_max_cols_query into l_max_cols;
        else
            RAISE_APPLICATION_ERROR(-20001, 'Cannot figure out max cols');
        end if;
        -- Now, construct the query that can answer the question for us...
        -- start with the C1, C2, ... CX columns:
        l_query := 'select ';
        for i in 1 .. p_anchor.count
        loop
            l_query := l_query || p_anchor(i) || ',';
        end loop;
        -- Now add in the C{x+1}... CN columns to be pivoted:
        -- the format is "max(decode(rn,1,C{X+1},null)) cx+1_1"
        for i in 1 .. l_max_cols
        loop
            for j in 1 .. p_pivot.count
            loop
                l_query := l_query ||
                    'max(decode(rn,'||i||','||
                               p_pivot(j)||',null)) ' ||
                                p_pivot(j) || '_' || i || ',';
            end loop;
        end loop;
        -- Now just add in the original query
        l_query := rtrim(l_query,',')||' from ( '||p_query||') group by ';
        -- and then the group by columns...
        for i in 1 .. p_anchor.count
        loop
            l_query := l_query || p_anchor(i) || ',';
        end loop;
        l_query := rtrim(l_query,',');
        -- and return it
        execute immediate 'alter session set cursor_sharing=force';
        open p_cursor for l_query;
        execute immediate 'alter session set cursor_sharing=exact';
    end;
    end;
    /I can see from the error message that it is ignoring the x declaration, I assume it is because it does not recognise the type refcursor from the procedure.
    How do I get it to recognise this?
    Thank you in advance

    Thank you for your help
    This is the version of Oracle I am running, so this may have something to do with that.
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.8.0 - Production
    I found this on Ask Tom (http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:3027089372477)
    Hello, Tom.
    I have one bind variable in a dynamic SQL expression.
    When I open cursor for this sql, it gets me to ora-01008.
    Please consider:
    Connected to:
    Oracle8i Enterprise Edition Release 8.1.7.4.1 - Production
    JServer Release 8.1.7.4.1 - Production
    SQL> declare
      2    type cur is ref cursor;
      3    res cur;
      4  begin
      5    open res for
      6    'select * from (select * from dual where :p = 1) connect by 1 = 1'
      7    using 1;
      8  end;
      9  /
    declare
    ERROR at line 1:
    ORA-01008: not all variables bound
    ORA-06512: at line 5
    SQL> declare
      2    type cur is ref cursor;
      3    res cur;
      4  begin
      5    open res for
      6    'select * from (select * from dual where :p = 1) connect by 1 = 1'
      7    using 1, 2;
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    And if I run the same thing on 10g -- all goes conversely. The first part runs ok, and the second
    part reports "ORA-01006: bind variable does not exist" (as it should be, I think). Remember, there
    is ONE bind variable in sql, not two. Is it a bug in 8i?
    What should we do to avoid this error running the same plsql program code on different Oracle
    versions?
    P.S. Thank you for your invaluable work on this site.
    Followup   June 9, 2005 - 6pm US/Eastern:
    what is the purpose of this query really?
    but it would appear to be a bug in 8i (since it should need but one).  You will have to work that
    via support. I changed the type to tarray to see if the reserved word was causing a problem.
    variable v_refcursor refcursor;
    set autoprint on;
    begin 
         crosstab.pivot (p_max_cols => 4,
                 p_query => 
                   'SELECT job, COUNT (*) cnt, deptno, ' || 
                   '       ROW_NUMBER () OVER ( ' || 
                   '          PARTITION BY job ' || 
                   '          ORDER BY deptno) rn ' || 
                   'FROM   emp ' ||
                   'GROUP BY job, deptno',
                   p_anchor => crosstab.tarray ('JOB'),
                   p_pivot => crosstab.tarray ('DEPTNO', 'CNT'),
                   p_cursor => :v_refcursor);
    end;
    /Was going to use this package as a stored procedure in forms but I not sure it's going to work now.

Maybe you are looking for

  • Ipad screen doesn't light up

    My ipad screen suddenly went dark without any external forces. At first I can hear the unlock/ lock sound when I slide across the screen and so touching is not a problem. I proceeded to sync my ipad and was prompted to upgrade to ios 7.0. I upgraded

  • Invoice regenerated after canceling

    Hi all, we have a problem that occurs from time to time. After we create for example a Debit Memo, we create a delivery and a billing document. Now sometimes we need to cancel the invoice again. So we go into vf02-billing document-cancel. A new docum

  • Drag problem on Microsoft Surface 1

    Hello, I explain my little problem I use Jquery and jquery.ui.touch-punch.min.js to make Drag work on mobile device....and you know what it works !! But because there is a but, I had to add an empty swipeleft function in edge to fixe the screen on Mi

  • Can we send attach with Inbound IDoc

    Hi All, I have requirement, Proxy to Idoc scenario where i need to send attchement along with Idoc message coming from proxy message. Can we do that? Also, i have another requirement as , i have 2 receivers , one is soap and one is Idoc , i need to s

  • I updated to OS X 10.8.5 and the icons for the files of one app have turned generic. How do I fix this?r

    I updated to OS X 10.8.5 and the icons for the files of one app were originally for another app (and opened it). I was able to make the files open the the original app but now the icons have turned generic. How do I fix this?