Ref cursor in exception block

Hi all.. I have a stored procedure that needs to return a records to Crystal Report.
I'm using an outpur parameter of type cursor.
In the proc, I am selecting the data from a table based on the input criteria and inserting into a GTT table,
if so, retrieve and store in the table and generate and throw output to CR.
if it is not returning any data i should raise exception and throw the related message to CR.
But in my proc even though it wont insert data into table b going inot next statements where it should not go.
create or replace procedure a(a1 varchar2,ref_cur out pkg1.cru)
as
cnt number;
begin
insert into b
(select * from a where a.col=a1);
commit;
open ref_cur for
select a.col from a;
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR (-20001, SQLERRM);
WHEN NO_DATA_FOUND THEN
     open ref_cur for
select 'No Data Found' col from dual;
end;
1.please suggest wherer to raise exception when "select * from a where a.col=a1" doesn't return any value.
2. Can ref cursor be used in exception block.
if i use condition like
after the insert statement
select count(*) into cnt from b;
if cnt=0 then
raise NO_DATA_FOUND;
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR (-20001, SQLERRM);
WHEN NO_DATA_FOUND THEN
     open ref_cur for
select 'No Data Found' col from dual;
please suggest any other way to handle
Thanks in advance

First and foremost some fundamental things:
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR (-20001, SQLERRM);
WHEN NO_DATA_FOUND THEN
open ref_cur for
select 'No Data Found' col from dual;
end;1. You can not declare WHEN OTHERS before any other EXCEPTION. You can not compile this. Here you have declared WHEN OTHERS first then NO_DATA_FOUND and it is erroneous.
2. This is not the way you want to handle the WHEN OTHERS exception.
WHEN OTHERS_
http://tkyte.blogspot.com/2008/06/when-others-then-null-redux.html
http://tkyte.blogspot.com/2007/03/dreaded-others-then-null-strikes-again.html
http://download.oracle.com/docs/cd/E11882_01/appdev.112/e17126/toc.htm

Similar Messages

  • Ref cursor from anonymous block

    I have no problem to get a ref cursor from a Fill method call with an anonymous pl/sql block. But if my anonymous block contains a DECLARE section, the dataset is not populated.
    ex:
    BEGIN OPEN :cuInscription FOR SELECT column FROM table; END;
    is ok but with
    DECLARE A NUMBER; BEGIN OPEN :cuInscription FOR SELECT column FROM table; END;
    the dataset is not populated (even if the SQL CALL succeed).
    Do you know about that?

    This issue has been fixed in the ODP.NET 92040 release.

  • How to fetch NO DATA FOUND exception in Ref Cursor.

    In my procedure ref cursor is out parameter with returns dataset. in my proceudre
    its like...
    OPEN pPymtCur FOR
    select.....
    when I call this procedure from report to get dataset it causes NO DATA FOUND exception.
    How to fetch this exception in my oracle procedure so I can get some other data.
    Any Idea to do this?
    Edited by: Meghna on 17-Jun-2009 22:28

    Mass25 wrote:
    Correct me if I am wrong.
    So if I do something as follows in my stored proc, I do not have to check for NO_DATA_FOUND?
    OPEN my_CuRSR FOR
          SELECT DISTINCT blah blah blahmy_cursr is what I am returning as OUT param in my SP.Correct. At the point you open the cursor, oracle has not attempted any 'fetch' against the data so it won't know if there is any data or no data. that only occurs when a fetch is attempted.
    Take a read of this:
    [PL/SQL 101 : Understanding Ref Cursors|http://forums.oracle.com/forums/thread.jspa?threadID=886365&tstart=0]

  • Manipulating data from a ref cursor in the data block of a form

    I am using Oracle Forms 10g. I have a ref cursor which returns columns A, B, C, D, E where B, C, D, E are values. The "Query Data Source Name" attribute in the datablock contains "CCTR_Extract_pkg.cctr_refcur". The "Column Name" attribute of item A contains "A", item B contains "B", etc. All of these columns are displayed on the form and it all works perfectly.
    I have a new request, the users would like a 6th column displayed - column F - where it equals D - B.
    Is there any way of doing this in the form only or do I need to change the ref cursor to accomodate the new column and then the form?
    If it can be achieved in the Form (only) - then how do I reference the 2 columns?
    Thanks in anticipation
    Michael
    Edited by: user8897365 on 24-Aug-2011 10:32

    Is there any way of doing this in the form only or do I need to change the ref cursor to accomodate the new column and then the form? The REF_CURSOR is the data source of your block so you will have to modify the CCTR_Extract_pkg package and cctr_refcur REF_CURSOR.
    If it can be achieved in the Form (only) - then how do I reference the 2 columns?After you have modified your database package, I recommend you run the Data Block Wizard on your block and let Forms detect the 2 new columns. You can do this manually, but it is safer to let Forms do it for you. If you want to do it manually, open the Query Data Source Columns property and add your new columns.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • How to print/store in file the ref cursor in pl/sql block ?

    How to print/store in file the ref cursor in pl/sql block ?.

    How to print/store in file the ref cursor in pl/sql block ?.You question is quite confusing?
    So, i'm providing link in this manner.
    For RefCursor,
    http://www.oracle-base.com/articles/misc/UsingRefCursorsToReturnRecordsets.php
    http://www.oracle.com/technology/oramag/code/tips2003/042003.html
    For UTL_FILE,
    http://www.morganslibrary.org/reference/utl_file.html
    Regards.
    Satyaki De.
    Updated with new morgan library link.
    Edited by: Satyaki_De on Feb 24, 2010 9:03 PM

  • DBMS_XMLGEN --Number of active cursors in increased in Exception block

    Hi ,
    We have a custom code that use DBMS_XMLGEN,the issue is when any exception happens the Number os active cusrors increse and when it happens in a lopp we hit 1000ORA-01000: maximum open cursors exceeded.
    Although I close the context in the exception Block.
    Below is sample code where I could replicate this:
    Step1.Create a table
    CREATE TABLE EMP(EMP_NO NUMBER,EMPNAME VARCHAR2(100));
    Step2:
    Create  a Procedure:
    CREATE OR REPLACE PROCEDURE TEST_XMLGEN
    AS
    l_clob CLOB;
      l_ctx         dbms_xmlgen.ctxhandle;
      p_sql VARCHAR2(4000):='SELECT EMP_NO,,EMPNAME FROM EMP';--syntax error on purpose ,so that exception happens
      l_cursor_count NUMBER;
    BEGIN
    SELECT VALUE
               INTO l_cursor_count
               FROM v$mystat a, v$statname b
              WHERE     a.statistic# = b.statistic#
                    AND b.name = 'opened cursors current';
            DBMS_OUTPUT.PUT_LINE ('open cursors place00' || l_cursor_count);
    l_ctx := dbms_xmlgen.newcontext (p_sql);
    SELECT VALUE
               INTO l_cursor_count
               FROM v$mystat a, v$statname b
              WHERE     a.statistic# = b.statistic#
                    AND b.name = 'opened cursors current';
             DBMS_OUTPUT.PUT_LINE('open cursors place01' || l_cursor_count);
    dbms_xmlgen.getxml (l_ctx,l_clob);
    SELECT VALUE
               INTO l_cursor_count
               FROM v$mystat a, v$statname b
              WHERE     a.statistic# = b.statistic#
                    AND b.name = 'opened cursors current';
             DBMS_OUTPUT.PUT_LINE ('open cursors place02' || l_cursor_count);
    DBMS_OUTPUT.PUT_LINE('l_clob:'||l_clob);
    dbms_xmlgen.closecontext (l_ctx);
    SELECT VALUE
               INTO l_cursor_count
               FROM v$mystat a, v$statname b
              WHERE     a.statistic# = b.statistic#
                    AND b.name = 'opened cursors current';
             DBMS_OUTPUT.PUT_LINE ('open cursors place03' || l_cursor_count);
    EXCEPTION
    WHEN OTHERS
    THEN
    SELECT VALUE
               INTO l_cursor_count
               FROM v$mystat a, v$statname b
              WHERE     a.statistic# = b.statistic#
                    AND b.name = 'opened cursors current';
             DBMS_OUTPUT.PUT_LINE ('open cursors place04' || l_cursor_count);
    dbms_xmlgen.closecontext (l_ctx);
    SELECT VALUE
               INTO l_cursor_count
               FROM v$mystat a, v$statname b
              WHERE     a.statistic# = b.statistic#
                    AND b.name = 'opened cursors current';
             DBMS_OUTPUT.PUT_LINE ('open cursors place05' || l_cursor_count);
    END;
    Step3: Execute above Procedure
    If you look at the number of active cursor it is increased in exception block,I suspect this is what is causing issue with my program too.Any suggestions to solve this issue.
    Thanks
    Shefali

    Did you mean this test:
    declare
      ts timestamp;
      type tp_strings is table of varchar2(32767) index by pls_integer;
      t_strings tp_strings;
      t_tmp xmltype;
      t_nd dbms_xmldom.domnode;
      t_nl dbms_xmldom.domnodelist;
      t_clob clob;
    begin
      t_clob := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'
             || '<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="5000" uniqueCount="5000">';
      for i in 1 .. 5000
      loop
        t_clob := t_clob || to_clob( '<si><t>A' || to_char( i ) || '</t></si>' );
      end loop;
      t_clob := t_clob || '</sst>';
      t_tmp := xmltype( t_clob );
      t_strings.delete;
      ts := systimestamp;
          select str
          bulk collect into t_strings
          from xmltable( xmlnamespaces( default 'http://schemas.openxmlformats.org/spreadsheetml/2006/main' )
                       , '/sst/si' passing t_tmp
                       columns str clob path 't'
      dbms_output.put_line( systimestamp - ts );
      dbms_output.put_line( t_strings.count() || ' ' || t_strings( t_strings.first )  || ' ' || t_strings( t_strings.last ) );
      t_strings.delete;
      ts := systimestamp;
          select /*+ NO_XML_QUERY_REWRITE */ str
          bulk collect into t_strings
          from xmltable( xmlnamespaces( default 'http://schemas.openxmlformats.org/spreadsheetml/2006/main' )
                       , '/sst/si' passing t_tmp
                       columns str clob path 't'
      dbms_output.put_line( systimestamp - ts );
      dbms_output.put_line( t_strings.count() || ' ' || t_strings( t_strings.first )  || ' ' || t_strings( t_strings.last ) );
      t_strings.delete;
      ts := systimestamp;
          t_nd := dbms_xmldom.makenode( dbms_xmldom.getdocumentelement( dbms_xmldom.newdomdocument( t_tmp ) ) );
          t_nl := dbms_xslprocessor.selectnodes( t_nd, '/sst/si/t/text()', 'xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"' );
          for i in 0 .. dbms_xmldom.getlength( t_nl ) - 1
          loop
            t_strings( i ) := dbms_xmldom.getnodevalue( dbms_xmldom.item( t_nl, i ) );
          end loop;
      dbms_output.put_line( systimestamp - ts );
      dbms_output.put_line( t_strings.count() || ' ' || t_strings( t_strings.first )  || ' ' || t_strings( t_strings.last ) );
    end;  

  • 6i report ref cursor exception no_data_found

    I have a simple report with one ref cursor query on a database packaged procedure.
    The Data Model function has an exception handler for no_data_found.
    The exception sets a local variable in a program unit spec.
    A field with a message based on a place holder column does not return.
    I am trying to give some message to the user & am not having luck.
    Ideas?
    Thank you.

    You can create a text field with the text "No data found".
    This field gets a format trigger
    if <your condition for no data found> then
      return true;
    else
      return false;
    end;

  • Forms Data-Block based on stored procedures - REF CURSOR feature NOT FUNCTIONING

    This topic is related to another topic in this forum titled "FORMS HOW TO SET QUERY SOURCE ARGUMENTS??" I posted my message there as well. I am posting as a NEW TOPIC so that it catches the attention of Oracle Support.
    I built a data form based on a stored procedure and REF CURSOR IN OUT parameter.
    My procedure takes a IN parameter to fill in the criteria for the OPEN <cursor_variable> select ... where ... statement.
    In the Value setting of the Query source Arguments , I set the VALUE to ":BLOCK_NAME.ITEM_NAME" at design time to supply the input value to the procedure. this works to the extent of making available the form item value to the stored procedure parameter. I verified this by doing an insert into some debug table , of the incoming parameter value inside my stored procedure.
    The cursor gets opened properly into the REF cursor variable. I verified this by fetching a record into a local variable and inserting the value into a debug table again in the stored procedure.
    (I took care to close and re-open the REF cursor variable again - so that the front-end can continue to fetch it from the first record. )
    ***** PROBLEM **************
    But the front end forms runtime is giving me a FRM-40301 - query returned no records even though the REF cursor is returned properly opened.
    Did anybody else face the same problem ??
    Please post what you found.
    Thanks,
    Shankaran
    null

    This topic is discussed at length in another thread "How Set Value For Query DataSource Arguments?"
    But I am posting the findings here as well.
    THIS TOPIC IS CLOSED.
    My Bad. The problem Cause : I did not include all columns in the
    cursor rowtype in the Data-block. In the wizard for the data block , I selected ONLY the columns that I needed. But I was doing a Select * from <my_table> in my open cursor <Cursor-Variable> .... The <Cursor Variable>
    itself was declared <my_table>%rowtype
    FIX : The Data Block structure (columns included as items) should match the cursor record Structure. One may or may not
    display all the columns in the LAYOUT though.
    But I don't understand why it gives such a misleading message like FRM-40301 Query retrieved no records. Oracle Team fix it.
    Hope this helps people who face the same problem.
    Thanks,

  • Call SP with application block (daab) & multiple out  REF CURSOR parameters

    Hi,
    I'm using Microsoft's data application blocks to execute a stroed procedure that look like this: (Note that I have not included the package declaration nor the T_CURSOR type declaration since it's working fine when I execute this procedure in a tool like TOAD or else)
    PROCEDURE qryTest(EMPLOYEE_ID IN VARCHAR, EMP_CUR OUT T_CURSOR, TASK_CUR OUT T_CURSOR)
         IS
         BEGIN     
              OPEN EMP_CUR FOR          
                   SELECT DISTINCT EMP_ID,
                        FIRSTNAME || ' ' || LASTNAME AS FULLNAME
                   FROM EMPLOYEE_TABLE     WHERE EMP_ID = EMPLOYEE_ID;
              OPEN TASK_CUR FOR          
                   SELECT DISTINCT T1.TASK_ID,
                        T1.TASKNAME
                   FROM TASK_TABLE     T1 INNER JOIN EMPLOYEE_TABLE T2 ON T1.EMP_ID = T2.EMP_ID     WHERE T2.EMP_ID = EMPLOYEE_ID;
    END qryTest;
    Then, I try to execute this SP from the data app blocks this way:
    First, I have a function that acts as a definition block to call the generic method calling the SP (VB.NET):
    Private Function getEmployees() As DataSet
    Dim prms(2) As OracleParameter
    prms(0) = New OracleParameter("EMPLOYEE_ID", OracleType.VarChar, 20, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Default, "6586")
    prms(1) = New OracleParameter("EMP_CUR", OracleType.Cursor, 30000, ParameterDirection.Output, True, 0, 0, "", DataRowVersion.Default, Nothing)
    prms(2) = New OracleParameter("TASK_CUR", OracleType.Cursor, 30000, ParameterDirection.Output, True, 0, 0, "", DataRowVersion.Default, Nothing)
    ds = DataBaseLAyer.ExecuteOracleProcedure("qryTest", False, prms)
    Return ds
    End Function
    And this is the function that execute the SP using the app blocks (C#):
              public static DataSet ExecuteOracleProcedure(string procName, bool createEmptyRow, params OracleParameter[] parameters)
                   Database db = DatabaseFactory.CreateDatabase("DBPACKAGENAME");
                   DBCommandWrapper cmd = db.GetStoredProcCommandWrapper(procName);
                   if(parameters != null)
                        foreach(OracleParameter param in parameters)
                             if(param.Direction == ParameterDirection.Input)
                                  cmd.AddInParameter(param.ParameterName, param.DbType, param.Value);
                             else
                                  cmd.AddOutParameter(param.ParameterName, param.DbType, param.Size);
                   DataSet ds = db.ExecuteDataSet(cmd);
                   return ds;
    When DataSet ds = db.ExecuteDataSet(cmd); is executed, I get this error:
    ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'QRYTEST' ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'QRYTEST'
    The procedure runs perfectly in TOAD but in here, it gives me this error several times in the same message...
    I did some tests and if I add another REF CURSOR (T_CURSOR) output param, I will get the error 3 times in the stack trace and so on...
    I know that the app block adds an out param implicitly which has to be named "cur_OUT" in my SP, which I TRIED without any success...
    Someone can help?
    Thanks for reading!

    My issue was that I was setting up my parameter in code as a DbType.Boolean. From what I could tell, the EntLib sends a 0/1 to the procedure and not a TRUE/FALSE which is what PL/SQL is expecting. My application works with both SQL Server and Oracle and SQL Server is smart enough (...ducking...) to figure it out that a 0 means false and a 1 means true. It does the conversion for you in T-SQL. Oracle has no clue. I spent way longer on this issue than I should have because I kept seeing posts that said "PL/SQL accepts BOOLEAN variables". Yea, well don't use them in this scenario. I ended up changing the parameter to use DbType.TinyInt and my problem went away. I suggest you try changing your parameters to NUMBER(1) and then to DbType.TinyInt in code and it should work just fine.
    I've only worked with PL/SQL for 2 months now so maybe I am missing something obvious but trying to find a post on this kind of thing is next to impossible.
    Let me know if that helped.
    Greg

  • REF CURSOR in PL/SQL BLOCK

    I am trying to return a ref cursor from a function in a package. I am trying to execute this through SQL Plus and cannot seem to get the code correct this is what I have. Please help. How do I display the output? I tried a CURSOR FOR loop, but got syntactical error saying it was being used inproperly.
    DECLARE
         v_rec      adp_vsp.grc_vsp;
         v_fname ps_personal_data.first_name%TYPE;
         v_lname ps_personal_data.last_name%TYPE;
    BEGIN
         v_fname := 'John';
         v_lname := 'Barr';
         v_rec := adp_vsp.f_get_vsp(v_fname,v_lname);
    END;

    If you want to do it manually, you need to loop through the cursor and fetch the results:
    sql>create or replace procedure p_show_emps(p_rc out sys_refcursor)
      2  is
      3  begin
      4    open p_rc for select empno, ename from emp where rownum <= 5;
      5  end;
      6  /
    Procedure created.
    sql>declare
      2    v_rc     sys_refcursor;
      3    v_empno  emp.empno%type;
      4    v_ename  emp.ename%type;
      5  begin
      6    p_show_emps(v_rc);
      7    loop
      8      fetch v_rc into v_empno, v_ename;
      9      exit when v_rc%notfound;
    10      dbms_output.put_line( v_empno || ', ' || v_ename );
    11    end loop;   
    12    close v_rc;
    13  end;
    14  /
    7369, SMITH
    7499, ALLEN
    7521, WARD
    7566, JONES
    7654, MARTIN
    PL/SQL procedure successfully completed.

  • Help needed in Ref cursor

    Hi,
    I am new to Ref Cursor concepts and I am trying a small block but its throwing error. Pls help me.
    PACKAGE SPEC:
    CREATE OR REPLACE PACKAGE PKG_JOBINFO AS
    PROCEDURE JOBINFO ( v_job_id IN number, p_cursor OUT PKG_JOBINFO.RESULT_REF_CURSOR);
    TYPE RESULT_REF_CURSOR IS REF CURSOR;
    END PKG_JOBINFO;
    PACKAGE BODY:
    CREATE OR REPLACE package body PKG_JOBINFO
    AS
    PROCEDURE JOBINFO ( v_job_id IN number,
    p_cursor OUT PKG_JOBINFO.RESULT_REF_CURSOR)
    AS
    BEGIN
    OPEN p_cursor FOR
    SELECT JOB_ID,
    JOB_NAME,
    TABLE_NAME
    FROM JOB_INFO
    WHERE JOB_ID=V_JOB_ID;
    EXCEPTION
    WHEN OTHERS THEN
    raise;
    END;
    END;
    While compiling the package i am not getting any errors. I am getting errors only while executing
    SQL> exec PKG_JOBINFO.JOBINFO ('23');
    BEGIN PKG_JOBINFO.JOBINFO ('23'); END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'JOBINFO'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Please help me to resolve this error.
    Thanks.

    user497267 wrote:
    Thanks its working. So if we are using ref cursor we have to execute like this only.To add...
    The actual issue you were experiencing was not because you were using ref cursors specifically, but because you had an OUT parameter in your procedure.
    When you have an OUT parameter, you need to ensure that you pass in a variable to that parameter of the procedure in order that the procedure can populate it. In your case you were only passing in the first parameter, but you weren't passing in a variable to capture the OUTput.
    What Alex showed was that by declaring a variable of the same datatype (ref cursor in your case) and passing that in as the second parameter, that variable was populated with the ref cursor information from inside the procedure. Once that variable was populated, after the procedure call, the data from that ref cursor can be obtained (using SQL*Plus' print command in Alex's example).

  • [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

  • Populate a REF CURSOR from regular cursor...

    Hi all,
    I apologize if the answer to this is somewhere...I've been looking on the web for sometime and can't find an answer to the following problem. I have a Significant Events database that contains network based issues and problems. As problems are detected on the network an SE is issued and published. As the SE records are updated, NEW records are entered into the table and "linked" back to the original. Each update results in a new row. Thus, an SE with two updates would have a total of 3 lines. When the SE gets closed (set the column CLOSED to SYSDATE), only the "original" SE is closed, any updates are left open...aka, the CLOSED column is left null.
    That said, I need a way to get the original and/or latest updated SE rows from the table. Thus, I am trying to use a PL/SQL package. The PL/SQL "must" return a REF CURSOR as the results are being passed to a client process.
    My initial approach was within a PL/SQL procedure, I have an SQL statement that returns the SE originals. Once in that cursor I need to do the following:
    - Attempt to fetch any linked SE rows.
    - if no rows then
    - add the original to the REF CURSOR.
    - else
    - find latest SE update
    - add latest SE update to REF CURSOR.
    - end if
    My Question is : How do I manually "add" a row to a REF CURSOR?
    If this is not possible, is there a way to populate a REF CURSOR from maybe another construct like:
    TYPE ian_se_record is RECORD (
    se_id number
    ,linked_se_id number
    ,submitted date
    ,updated date
    ,closed date
    ,segroup varchar2(150)
    ,incident_start_time varchar2(150)
    ,business_units_affected varchar2(150)
    ,officenum varchar2(1500)
    ,sedetails varchar2(4000)
    TYPE ian_se_table is table of ian_se_record index by binary_integer;
    With the above construct I could:
    - Fill ian_se_table with the process described above.
    - And finally select off ian_se_table into the REF CURSOR?
    Any help would be greatly appreciated,
    adym

    Hi michaels,
    I've put your solution in place, but can't seem to get it to run. The two types were moved out of the package and into real types as you said. Here's the function, for brevity, I've remove some of the less important code:
    function ian_se_fetch return sys_refcursor
    is
        p_csr_events            sys_refcursor;
        cursor csr_items is
            select
                 se_id
        ...removed for brevity...
        /* END : csr_items  */
        ian_se_row     ian_se_record;
        ian_se_tbl     ian_se_table;
        l_lng_index    number;
        l_lng_linked   number;
        l_lng_id       number;
    begin
         * OPEN : Open the main cursor of originals...
        for the_item in csr_items loop
             * CHECK : Check for any updates to the original...
            l_lng_linked := 0;
            select count(*)
            into l_lng_linked
            from sig_se_t src
            where src.linked_se_id = the_item.se_id;
            l_lng_id := 0;    /* reset the se-id    */
            /* SE original...no linked records yet.    */
            if ( l_lng_linked = 0 ) then
                l_lng_id := the_item.se_id;
            /* SE updates...one or more updates are present.    */
            else
                begin
                    select
                         se_id
                    into l_lng_id
                    from sig_se_t src
                    where src.linked_se_id = the_item.se_id
                      and rownum = 1
                    order by updated desc; /* latest update    */
                exception
                    when too_many_rows then
                        l_lng_id := the_item.se_id;
                    when others then
                        l_lng_id := 0;
                end;
            end if;
            if ( l_lng_id != 0 ) then
                select
                     se_id
                    ,linked_se_id
                    ,submitted
                    ,updated
                    ,closed
                    ,segroup
                    ,incident_start_time
                    ,business_units_affected
                    ,officenum || decode( nvl(impact,'1')
                                      ,'1',''
                                      ,decode(impact
                                          ,'NA', ''
                                          ,':' || impact
                                  )                           impact
                    ,sedetails
                into ian_se_row.se_id
                    ,ian_se_row.linked_se_id
                    ,ian_se_row.submitted
                    ,ian_se_row.updated
                    ,ian_se_row.closed
                    ,ian_se_row.segroup
                    ,ian_se_row.incident_start_time
                    ,ian_se_row.business_units_affected
                    ,ian_se_row.officenum
                    ,ian_se_row.sedetails
                from sig_se_t src
                where src.se_id = l_lng_id;
                l_lng_index := nvl(ian_se_tbl.last,0)+1;
                ian_se_tbl(l_lng_index).se_id                   := ian_se_row.se_id;
                ian_se_tbl(l_lng_index).linked_se_id            := ian_se_row.linked_se_id;
                ian_se_tbl(l_lng_index).submitted               := ian_se_row.submitted;
                ian_se_tbl(l_lng_index).updated                 := ian_se_row.updated;
                ian_se_tbl(l_lng_index).closed                  := ian_se_row.closed;
                ian_se_tbl(l_lng_index).segroup                 := ian_se_row.segroup;
                ian_se_tbl(l_lng_index).incident_start_time     := ian_se_row.incident_start_time;
                ian_se_tbl(l_lng_index).business_units_affected := ian_se_row.business_units_affected;
                ian_se_tbl(l_lng_index).officenum               := ian_se_row.officenum;
                ian_se_tbl(l_lng_index).sedetails               := ian_se_row.sedetails;
            end if;
        end loop;
         * REF CURSOR : Open the ref cursor on the dataset...
        if ( nvl(ian_se_tbl.last,0) = 0 ) then
            p_csr_events := null;
        else
            open p_csr_events for
            select *
            from table (cast ( ian_se_tbl as ian_se_table ));
        end if;
        return p_csr_events;
    end;Here's the test. I keep getting the same error ORA-06530:
    SQL> variable v refcursor;
    SQL> exec :v:=pkg_ian.ian_se_fetch;
    BEGIN :v:=pkg_ian.ian_se_fetch; END;
    ERROR at line 1:
    ORA-06530: Reference to uninitialized composite
    ORA-06512: at "N0002501.PKG_IAN", line 131
    ORA-06512: at line 1
    SQL> print v
    ERROR:
    ORA-24338: statement handle not executedOther things I tried:
    - The ian_se_fetch() function was a procedure using an in out parameter...same error.
    - Wrote a small anonymous block and tried to LOOP/FETCH. Same ORA-06530 error.
    P.S. Line 131 of pkg_ian is the SELECT ... INTO ian_se_row.se_id, ...
    Any help would be greatly appreciated,
    tia,
    adym
    Message was edited by:
    alink

  • Create record variable that refers dynamic query assigned to a ref cursor?

    Hi ,
    Just explaining what I am trying to achieve:
    1) i have a hr.departments table that was loaded in hr schema on 1st oct 2012 with 4 columns(department_id, department_name, manager_id, location_id)
    2) now I have a new schema by my name 'rahul' and I have loaded departments table but now an additional column has come into picture,ie created_date, this table got loaded on 1st-Nov-2012
    3) Now going forward my columns could be dropped from the departments table (it can be a case), for example might be my departments table in my schema 'rahul' one day could comprise of only 3 columns(department_id,department_name,manager_id)
    4) Now in the next step, I have managed to extract common column names(in a single line where columns are delimited using a comma) from both the tables(hr.departments and rahul.departments) which are (department_id, department_name, manager_id, location_id) using all_tab_cols table and I have written a function for it which i will be pasting below.
    5) now going forward, using the above column names line with column names delimited using comma, I have used a ref cursor and assigned a query to it using the line of columns that I have extracted from the above point
    6) Now I want to create a record variable which refers to my ref cursor, something like we do when we create a record variable by reffering to an explicit cursor defination that we give in the declaration block.
    PS:
    1) I have been out of touch with plsql for a long time so I have lost a lot of mmeory regarding plsql.
    2) basically I need to compare data in hr.departments table with rahul.departments table for only columns that are common to both the tables, rest new or discarded columns information will go in one of the log tables that I have created(this is done already)
    Please help me, I did try searching on google for the same but it really confused me very badly, any kind of help is appreciated, please find my code below:
    Regards
    Rahul
    Code :
    ===================================================================================================
    create or replace procedure p_compare_data(fp_old_table_name in varchar2, fp_new_table_name in varchar2)
    is
    type ref_cursor_old_table is ref cursor;
    v_ref_cursor_old_table ref_cursor_old_table;
    --record_v_ref_cursor_old_table v_ref_cursor_old_table;
    --record_ref_cursor_old_table v_ref_cursor_old_table%ROWTYPE;
    Lv_all_column_names varchar2(2000);
    function f_fetch_common_column_names(fp_old_table_name in varchar2, fp_new_table_name in varchar2)
    return varchar2
    is
              Lv_all_column_names varchar2(2000);
    begin
              execute immediate 'select ltrim(all_column_names,'','') all_column_names_in_line from (select * from (select sys_connect_by_path(hr_e_column_name,'','') all_column_names from (select hr_e_column_name, rownum curr, rownum - 1 prev from (select hr_e.* , rahul_e.* , case when (hr_e_column_name = rahul_e_column_name) then 1 when (rahul_e_column_name is NULL) then 2 when (hr_e_column_name is NULL) then 3 end decision from (select column_name hr_e_column_name from all_tab_cols where owner ='''||substr(fp_old_table_name,1,instr(fp_old_table_name,'.',1,1)-1)||''' and table_name = '''||substr(fp_old_table_name,instr(fp_old_table_name,'.',1,1)+1)||''') hr_e full outer join (select column_name rahul_e_column_name from all_tab_cols where owner = '''||substr(fp_new_table_name,1,instr(fp_new_table_name,'.',1,1)-1)||''' and table_name = '''||substr(fp_new_table_name,instr(fp_new_table_name,'.',1,1)+1)||''') rahul_e on hr_e.hr_e_column_name = rahul_e.rahul_e_column_name) decision_table where decision = 1) a start with a.curr = 1 connect by prior curr = prev) b order by length(b.all_column_names) desc) all_column_names_in_line where rownum = 1' into Lv_all_column_names;
              return (Lv_all_column_names);
    end;
    begin
         Lv_all_column_names := f_fetch_common_column_names(fp_old_table_name, fp_new_table_name);
         --dbms_output.put_line(Lv_all_column_names);
         open v_ref_cursor_old_table for ('select '||Lv_all_column_names||' from '||fp_old_table_name);
    end;
    =====================================================================================================

    >
    6) Now I want to create a record variable which refers to my ref cursor, something like we do when we create a record variable by reffering to an explicit cursor defination that we give in the declaration block.
    >
    This thread is basically nothing more than a continuation of your original thread except now you are finally explaining what you are really trying to do.
    Re: passing table name to a procedure and then need to open a cursor ..
    In that original thread you said you found the solution
    >
    Well Mate thanks for your suggestion but I got it working through ref cusror, thanks for your time.
    >
    So I ask you to post your 'solution' and when you finally did it was clear that you hadn't solved anything at all. Your solution used a ref cursor all right but the code relied on a record ('record_employees') that was based on a table name ('employees') that was declared within the procedure. There isn't much point in passing in a table name if you have to hard-code the table name in the procedure.
    create or replace procedure p_ref_cursor(fp_old_table in varchar2)
    is
    type ref_cursor is REF CURSOR;
    v_ref_cursor ref_cursor;
    record_employees hr.employees%ROWTYPE;
    begin
    open v_ref_cursor for 'select * from '||fp_old_table;
    loop
    fetch v_ref_cursor into record_employees;
    exit when v_ref_cursor%NOTFOUND;
    dbms_output.put_line(record_employees.employee_id);
    end loop;
    end;Then sb92075 ask you the question that illustrates what I just said
    >
    what happens when you pass in "HR.DEPARTMENTS" ; besides throwing errors?
    >
    And you blew him off with this
    >
    Mate, departments never came in my context, in my prior message I explained what I was trying to achieve ... so I dont know what problem you are understanding reading my posts.
    >
    And now here you are asking how to get this to work for the departments table.
    It is very difficult to help someone that won't tell us what it is they are really trying to do so we can try to suggest some better ways of doing it. Hopefully, in the future, you wil start by explaining your problems instead of focusing on the solution you think you should use.
    Back to the issue -
    The first thing you should do is finish defining the requirements. Assuming the above actually works to identify columns that have different data what are you going to do with that information?
    1. Do you need to save that different data from TABLE1 somewhere?
    2. If you don't save it how will anyone look at it to decide which table has the correct data?
    3. If you do save it how will you save it 'generically' since other tables will have different columns and datatypes?
    4. What about the data from the same record in TABLE2; do you need to save that data somewhere?
    5. Will these two tables have primary keys? Are they on the same columns in each table? If not what if TABLE1 has one record but there are TWO records in TABLE2 that are identical. Is that a match? Or is that a problem because TABLE2 has an extra record even though the record is identical?
    In short detecting the differences is just one small part of the entire problem. You also need to save those differences somewhere so someone can examine the data and decide what action to take. That is the more difficult part of trying to implement a 'generic' solution.
    But now that we know what you are really trying to do take a read through this thread from 6 years ago. It has three different ways to pass a query to a procedure and get different output. You may want to save a copy of the thread since it has some very advanced techniques in it.
    How to pipeline a function with a dynamic number of columns?
    See ascheffer's reply Posted: May 9, 2006 4:53 AM for using data cartridge functionality with a pipelined function.
    See Kamal's reply Posted: May 10, 2006 4:49 AM - it shows how to get XML output.
    See BluShadow's reply Posted: Mar 27, 2009 1:50 AM - for using dynamic sql

  • Dynamic REF Cursor with Dynamic Fetch - Urgent

    i have a pl/sql package with generates dynamic SQL statments. my problem is i want to open this SQL statment dynamically and fetch data in dynamic variable.
    declare
    type type_temp is REF CURSOR;
    cur_temp type_temp;
    mv_sql varchar2(4000);
    begin
    -- this will be dunamically generated and
    -- hence could have any no. of columns.
    mv_sql := select f1, f2, f3, f4 from table_temp;
    open cur_temp for mv_sql;
    fetch cur_temp into c1, c2, c3, c4;
    close cur_temp;
    end;
    problem is my sql statment will have N no. of columns how can i fetch this N no. of columns.

    Very hard problem, because ref cursors do not (directly) support description!
    Se mine (non-ideal) solution (it may be doable, but it isn't very practical
    or easily maintainable):
    1. "Generic" package
    CREATE OR REPLACE PACKAGE dyn_fetch IS
    TYPE ref_cur_t IS REF CURSOR;
    g_query VARCHAR2 (32000);
    g_count NUMBER;
    g_desc_tab DBMS_SQL.DESC_TAB;
    varchar2_type CONSTANT PLS_INTEGER := 1;
    number_type CONSTANT PLS_INTEGER := 2;
    date_type CONSTANT PLS_INTEGER := 12;
    rowid_type CONSTANT PLS_INTEGER := 11;
    char_type CONSTANT PLS_INTEGER := 96;
    long_type CONSTANT PLS_INTEGER := 8;
    raw_type CONSTANT PLS_INTEGER := 23;
    mlslabel_type CONSTANT PLS_INTEGER := 106;
    clob_type CONSTANT PLS_INTEGER := 112;
    blob_type CONSTANT PLS_INTEGER := 113;
    bfile_type CONSTANT PLS_INTEGER := 114;
    PROCEDURE describe_columns;
    FUNCTION record_def RETURN VARCHAR2;
    END;
    CREATE OR REPLACE PACKAGE BODY dyn_fetch IS
    PROCEDURE describe_columns IS
    l_cur INTEGER;
    BEGIN
    l_cur := DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE (l_cur, g_query, DBMS_SQL.NATIVE);
    DBMS_SQL.DESCRIBE_COLUMNS (l_cur, g_count, g_desc_tab);
    DBMS_SQL.CLOSE_CURSOR (l_cur);
    EXCEPTION
    WHEN OTHERS THEN
    IF DBMS_SQL.IS_OPEN (l_cur) THEN
    DBMS_SQL.CLOSE_CURSOR (l_cur);
    END IF;
    RAISE;
    END;
    FUNCTION record_def RETURN VARCHAR2 IS
    l_record_def VARCHAR2 (32000);
    l_type VARCHAR2 (100);
    l_col_type PLS_INTEGER;
    l_col_max_len PLS_INTEGER;
    l_col_precision PLS_INTEGER;
    l_col_scale PLS_INTEGER;
    BEGIN
    FOR i IN 1..g_count LOOP
    l_col_type := g_desc_tab(i).col_type;
    l_col_max_len := g_desc_tab(i).col_max_len;
    l_col_precision := g_desc_tab(i).col_precision;
    l_col_scale := g_desc_tab(i).col_scale;
    IF l_col_type = varchar2_type THEN
    l_type := 'VARCHAR2(' || l_col_max_len || ')';
    ELSIF l_col_type = number_type THEN
    l_type := 'NUMBER(' || l_col_precision || ',' || l_col_scale || ')';
    ELSIF l_col_type = date_type THEN
    l_type := 'DATE';
    ELSIF l_col_type = rowid_type THEN
    l_type := 'ROWID';
    ELSIF l_col_type = char_type THEN
    l_type := 'CHAR(' || l_col_max_len || ')';
    -- ELSIF l_col_type = ...
    -- long_type, raw_type ...
    END IF;
    l_record_def := l_record_def || ' col_' || i || ' ' || l_type || ',';
    END LOOP;
    l_record_def := RTRIM (l_record_def, ',');
    RETURN l_record_def;
    END;
    END;
    Note that procedure "record_def" creates columns names as col_1 (col_2 ...)
    because SELECT clause in your query can be without aliases, for example
    "SELECT deptno || dname FROM dept".
    2. Your package which returns query nad ref cursor
    CREATE OR REPLACE PACKAGE test IS
    PROCEDURE set_query (p_query VARCHAR2 := NULL);
    FUNCTION ref_cur RETURN dyn_fetch.ref_cur_t;
    END;
    CREATE OR REPLACE PACKAGE BODY test IS
    PROCEDURE set_query (p_query VARCHAR2 := NULL) IS
    l_query VARCHAR2 (32000) :=
    ' SELECT e.empno, e.ename,' ||
    ' e.deptno, d.dname' ||
    ' FROM emp e,' ||
    ' dept d' ||
    ' WHERE e.deptno = d.deptno';
    BEGIN
    IF p_query IS NULL THEN
    dyn_fetch.g_query := l_query;
    ELSE
    dyn_fetch.g_query := p_query;
    END IF;
    END;
    FUNCTION ref_cur RETURN dyn_fetch.ref_cur_t IS
    l_ref_cur dyn_fetch.ref_cur_t;
    BEGIN
    OPEN l_ref_cur FOR dyn_fetch.g_query;
    RETURN l_ref_cur;
    END;
    END;
    Why we need two separate procedures (functions) in your package ?
    a) Receiving program must use dynamic SQL, but in dynamic block we can access
    only PL/SQL code elements that have global scope (standalone functions and procedures,
    and elements defined in the specification of a package).
    Unfortunately, cursor variables cannot be defined in the specification of a package
    (cannot be global variables).
    b) Receiving program must get the column list before ref cursor.
    So, we have two options: call (in receiving program) the same function two times
    (once to get the column list and once to return a ref cursor)
    or use one procedure (or function) for returning query (to get the column list)
    and second function for returning a ref cursor.
    3. Your receiving program
    CREATE OR REPLACE PROCEDURE test_fetch_ref_cur (p_query VARCHAR2 := NULL) IS
    l_statement VARCHAR2 (32000);
    FUNCTION process_def RETURN VARCHAR2 IS
    l_process_def VARCHAR2 (32000);
    BEGIN
    l_process_def := 'DBMS_OUTPUT.PUT_LINE (';
    FOR i IN 1 .. dyn_fetch.g_count LOOP
    l_process_def := l_process_def || ' l_record.col_' || i || ' || ''>>'' || ';
    END LOOP;
    l_process_def := RTRIM (l_process_def, ' || ''>>'' || ') || ');';
    RETURN l_process_def;
    END;
    BEGIN
    test.set_query (p_query);
    dyn_fetch.describe_columns;
    l_statement :=
    ' DECLARE' ||
    ' TYPE record_t IS RECORD (' ||
    dyn_fetch.record_def || ');' ||
    ' l_record record_t;' ||
    ' l_ref_cur dyn_fetch.ref_cur_t;' ||
    ' BEGIN' ||
    ' l_ref_cur := test.ref_cur;' ||
    ' LOOP' ||
    ' FETCH l_ref_cur INTO l_record;' ||
    ' EXIT WHEN l_ref_cur%NOTFOUND;' ||
    process_def ||
    ' END LOOP;' ||
    ' CLOSE l_ref_cur;' ||
    ' END;';
    EXECUTE IMMEDIATE l_statement;
    END;
    You can test this with:
    SET SERVEROUTPUT ON;
    EXECUTE test_fetch_ref_cur;
    Note that we can try to use more generic solution:
    CREATE OR REPLACE PACKAGE dyn_fetch IS
    -- SAME AS BEFORE, PLUS:
    PROCEDURE fetch_ref_cur (
    p_function_ref_cur VARCHAR2,
    p_process_def VARCHAR2);
    END;
    CREATE OR REPLACE PACKAGE BODY dyn_fetch IS
    -- SAME AS BEFORE, PLUS:
    PROCEDURE fetch_ref_cur (
    p_function_ref_cur VARCHAR2,
    p_process_def VARCHAR2)
    IS
    l_statement VARCHAR2 (32000);
    BEGIN
    l_statement :=
    ' DECLARE' ||
    ' TYPE record_t IS RECORD (' ||
    record_def || ');' ||
    ' l_record record_t;' ||
    ' l_ref_cur dyn_fetch.ref_cur_t;' ||
    ' BEGIN' ||
    ' l_ref_cur := ' ||
    p_function_ref_cur || ';' ||
    ' LOOP' ||
    ' FETCH l_ref_cur INTO l_record;' ||
    ' EXIT WHEN l_ref_cur%NOTFOUND;' ||
    p_process_def ||
    ' END LOOP;' ||
    ' CLOSE l_ref_cur;' ||
    ' END;';
    EXECUTE IMMEDIATE l_statement;
    END;
    END;
    CREATE OR REPLACE PROCEDURE test_fetch_ref_cur (p_query VARCHAR2 := NULL) IS
    FUNCTION process_def RETURN VARCHAR2 IS
    -- SAME AS BEFORE
    END;
    BEGIN
    test.set_query (p_query);
    dyn_fetch.describe_columns;
    dyn_fetch.fetch_ref_cur (
    p_function_ref_cur => 'test.ref_cur',
    p_process_def => process_def);
    END;
    Regards,
    Zlatko Sirotic

Maybe you are looking for

  • The music I have purchased on my IPod are not showing up on my ITunes library on my computer

    The music I have purchased on my IPod is not showing up on my Itunes account on my computer, I went to the itunes store on my computer and went to see if I could download a song i previously purchased, but it was going to have me pay again. I have ab

  • Printing in GNOME on OES2 server

    Hello, I'm trying to set-up a network printer in GNOME for the root user on an OES2 server. Since I'm not familiar with Linux, I'm a little bit in the dark here. The iPrint part is working (tested from a workstation), but when I try to install an iPr

  • File BPM Webservice IDOC .........Error in BPM workflow(Sync send step)

    Hi all,                   I have the same type scenario that is file initiates the bpm that invokes the Webservice.the file data goes into bpm as the input data of the webservice and webservice gives the response and then the web-service response is

  • Can't Drag (or make alias) Folder from Home Documents into Documents

    I have a folder called Documents in Finder's sidebar... and also one under my name (home)... they match up pretty well, but there is one folder in my home>documents file that I cannot get to drop into the Documents file in my sidebar. Why is this? I'

  • No digital audio in/out - help

    Cannot establish a digital audio out/in connection. Stuck in analog mode. When I plug in a mini toslink the audio OX driver audio device indicates "headphones". There is no red signal being emitted from the optical cable either. Cable checks out ok o