Storing a database result set in a variable

Hi Experts,
Is is possible to store a result set from a database query and store it in a variable?
If so how could that be done.
I have a requirement where in, I have to select * from a database table and send the result set in the body of an email...
How this is feasible?
Any pointer will definitely help..

Hi ,
Just have a look this may helpful for u..
http://odiexperts.com/category/sql-2
http://odiexperts.com/category/logic
Thanks,
Ananth

Similar Messages

  • Struts database result set storage structure

    Hi all. I am working on a struts application that will return results from a database. The question that I am currently uncertain of is how I should be storing the information from the database. I had thought about using a datastructure to store all of the results and then realized that would be unrealistic given the possible result size. I have instead decided to store only the items that will be displayed on the page. I just wanted to see if this seems like a reasonable idea, given that most people find what they are looking for on the first page or two. Any other thoughts on this would be appreciated.

    No that's why I was thinking of using a resultsetin
    the Session. I am guessing that I'll need to do
    profiling in order to determine the size that Iwill
    use. I was thinking of using between 20-50results
    per page, leaning more heavily to the 20 - doesthat
    sound reasonable ?Yes, but why pass that result set around for that? It
    only might give you problems because you can't close
    the statement that created it without passing that
    around as well. If you close either at all. Also, a
    JSP should never have to deal with DB access. It's
    just supposed to display data, not to retrieve it.I guess I should have been more explicit. I will be passing around 20-50 results stored in their own datastructure. I was using the word resultset but should have instead been using simply result. Thanks for the info.

  • Calling stored procedure returning result set

    Hi all,
    i know this issue is discussed quite often. I did not find an answer in the forums, not in the manual and even not in the examples for stored procedure.
    So i try it here once more :)
    Description:
    GET_SKS:
    The GET_SKS procedure is used to generate a number of surrogate keys. It has one input parameter NUM_SKS_IN that specifies the number of keys to generate. The generated keys are returned as a result set.
    So i tried:
    CallableStatemant sproc_stmt = lsession.connection().prepareCall("{ call Get_SKS(?,?)}");
    sproc_stmt.setInt(2,1);
    sproc_stmt.registerOutParameter(1,OracleTypes.CURSOR);
    sproc_stmt.execute();
    ResultSet sproc_result = (ResultSet) sproc_stmt.getObject(1);
    I got the exception:
    java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'GET_SKS'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Thanks for help! This is really getting frustrating...
    Regards,
    ak

    Hi there,
    i could speak to our one of our admins. This is what he gave me:
    CREATE OR REPLACE PROCEDURE "TCSDBOWNER"."GET_SKS"
       (num_sks_in IN INTEGER,
        sk_out OUT SYS_INFO.SYS_INFO_SK%TYPE)
    AS
    /*+
    || Procedure - GET_SKS - Oracle
    ||
    || Description:
    ||   This procedure is used to get one or more primary keys for tables with
    ||   surrogate keys as the primary key.  This number is unique across all
    ||   tables and installations for a given client.
    ||
    || Parameters:
    ||   num_sks_in - INTEGER: number of surrogate keys to return
    ||   sk_out - sk_subtype: first key in the sequence of requested keys
    ||
    || History:
    ||   08/30/01,dcs: Created
      CURSOR request_cur IS
        select DBMS_LOCK.REQUEST(170333184) from dual;
      CURSOR release_cur IS
        select DBMS_LOCK.RELEASE(170333184) from dual;
      CURSOR dual_sk_cur IS
         select SEQ_SK.NEXTVAL SK
           from DUAL;
      v_base_offset SYS_INFO.BASE_OFFSET%TYPE;
      v_sk SYS_INFO.SYS_INFO_SK%TYPE;
      v_sqlstring VARCHAR2(1000);
      v_cursor_handle INTEGER;
      v_return INTEGER;
    BEGIN
      IF num_sks_in < 1 THEN
        TCS_EXC.RAISE_ERROR(TCS_EXC.num_sks_in_lt_1);
      END IF;
      OPEN request_cur;
      FETCH request_cur INTO v_return;
      CLOSE request_cur;
      IF v_return <> 0 AND v_return <> 4 THEN
        TCS_EXC.RAISE_ERROR(TCS_EXC.sk_gen_lock_failed);
      END IF;
      v_cursor_handle := DBMS_SQL.OPEN_CURSOR;
      v_sqlstring := 'ALTER SEQUENCE SEQ_SK INCREMENT BY '|| TO_CHAR(num_sks_in);
      DBMS_SQL.PARSE(v_cursor_handle, v_sqlstring, DBMS_SQL.V7);
      v_return := DBMS_SQL.EXECUTE(v_cursor_handle);
      DBMS_SQL.CLOSE_CURSOR(v_cursor_handle);
      GET_BASE_OFFSET(v_base_offset);
      OPEN dual_sk_cur;
      FETCH dual_sk_cur INTO v_sk;
      CLOSE dual_sk_cur;
      sk_out := (v_base_offset * 10000000000) + v_sk - num_sks_in + 1;
      v_cursor_handle := DBMS_SQL.OPEN_CURSOR;
      v_sqlstring := 'ALTER SEQUENCE SEQ_SK INCREMENT BY 1';
      DBMS_SQL.PARSE(v_cursor_handle, v_sqlstring, DBMS_SQL.V7);
      v_return := DBMS_SQL.EXECUTE(v_cursor_handle);
      DBMS_SQL.CLOSE_CURSOR(v_cursor_handle);
      OPEN release_cur;
      FETCH release_cur INTO v_return;
      CLOSE release_cur;
      IF v_return <> 0 THEN
        TCS_EXC.RAISE_ERROR(TCS_EXC.sk_gen_lock_failed);
      END IF;
    END GET_SKS; Ok, i tried with that but even not succeded yet. Can anybody help me to code that into a java call?
    Regards,
    ak

  • Put database result set into a vector?

    I have a resultset rs I would like to put into a vector but I don't seem to get something fundamental. I can put individual items in with add() for instance but how do I dump a whole result set in there...
    and if I do so should I turn them all to strings before putting them into the vector?
    Any general advice would be appreciated, I've read a lot about Vectors today and have ended up more confused than I'd have expected. So I have come to seek some basic advice.
    private static void showResult (ResultSet rs) throws SQLException {
                            Vector vector = new Vector();
             try
                     // rs is the resultset output from a database
                                      vector.addAll(rs);
             catch(NullPointerException ex)
                    System.out.println("bugger - null pointer exception");
                    System.out.println();
                    ex.printStackTrace();
    }

    Iterate over the resultset, create your own object to store data for each row and add that object to the vector. There is no escape from this.
    catch(NullPointerException ex)You should not be handling Runtime exceptions. You need to take care not to let them occur through your coding logic.

  • Advice Please: Adding Few Static Values to Stored Proc Returned Result Set

    Hello -
    The Stored Proc below returns about 1000 rows of result set when a date is passed to the query. In addition to that, there are about 5 rows of data (which is in my excel file) needs to be added to the result set. What is the best possible way?
    What I have done is I created a new table which has that 5 static rows. It has just the addresses and amount and customer number. There is no invoice date in that table. I tried UNION and the query did not like the fact that I had something like that in
    the first table:
    SELECT
    '0' as 'TYPE'
    ,'TBCCA' as 'Acc ID'
    ,'12882' as 'BEID'
    , '' as ' # OF UNITS'
    , Circuit_Total as 'AMT'
    ,'D' as 'D or C'
    , '' as ' FDOC yyyymmdd'
    , '' as ' LDOC yyyymmdd'
    , Address as 'Brief Comment'
    , city as 'Tax City'
    , State as 'Tax State'
    , Zip_Code as 'Tax Zip Code'
    , INV_DATE as 'Invoice Date'
    FROM [dbo].[TBC_MonthlyCircuitDetail]
    WHERE INV_DATE = '2014-07-01'
    AND [Circuit_Total] >0
    UNION
    SELECT 0
    '0' as 'TYPE' --DID NOT LIKE THIS <<
    ,'TBCCA' as 'Acc ID'
    ,'12882' as 'BEID'
    , '' as ' # OF UNITS'
    , Circuit_Total as 'AMT'
    ,'D' as 'D or C'
    , '' as ' FDOC yyyymmdd'
    , '' as ' LDOC yyyymmdd'
    , Address as 'Brief Comment'
    , city as 'Tax City'
    , State as 'Tax State'
    , Zip_Code as 'Tax Zip Code'
    , '' INV_DATE as 'Invoice Date'
    FROM [dbo].[TBC_MonthlyCircuitDetailStaticValues]
    WHERE INV_DATE = '2014-07-01'
    AND [Circuit_Total] >0
    Stored Proc below:
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[SP_TBC_ORBIT Process Form]
    -- Add the parameters for the stored procedure here
    @INVOICE_DATE varchar(20)
    AS
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;
    -- Insert statements for procedure here
    SELECT
    '0' as 'TYPE'
    ,'TBCCA' as 'Acc ID'
    ,'12882' as 'BEID'
    , '' as ' # OF UNITS'
    , Circuit_Total as 'AMT'
    ,'D' as 'D or C'
    , '' as ' FDOC yyyymmdd'
    , '' as ' LDOC yyyymmdd'
    , Address as 'Brief Comment'
    , city as 'Tax City'
    , State as 'Tax State'
    , Zip_Code as 'Tax Zip Code'
    , INV_DATE as 'Invoice Date'
    FROM [dbo].[TBC_MonthlyCircuitDetail]
    WHERE INV_DATE IN (@INVOICE_DATE)
    AND [Circuit_Total] >0
    END
    GO
    So, what do you suggest? As you can tell, I am quite a novice but I am learning by researching, asking questions and doing it. Thanks in advance!
    Sanjeev Jha

    Your second Select statement is as below:
    SELECT 0
      '0' as 'TYPE'
    --DID NOT LIKE THIS <<
    ,'TBCCA' as
    'Acc ID'
    ,'12882' as
    'BEID'
    , '' as
    ' # OF UNITS'
    , Circuit_Total as
    'AMT'
    ,'D' as 'D or C'
    , '' as
    ' FDOC yyyymmdd'
    , '' as
    ' LDOC yyyymmdd'
    , Address as
    'Brief Comment'
    , city as 'Tax City'
    , State as
    'Tax State'
    , Zip_Code as
    'Tax Zip Code'
    , ''INV_DATE
    as 'Invoice Date'  -- CHANGE HERE
    FROM [dbo].[TBC_MonthlyCircuitDetailStaticValues]
    WHERE INV_DATE = '2014-07-01'
    AND [Circuit_Total] >0
    You are receiving Invoice date from INV_DATE column from table or you want to set it as blank?
    Change it to either - ( '' as
    'Invoice Date' ) or  (INV_DATE as
    'Invoice Date'  )
    -Vaibhav Chaudhari

  • Question on storing mult row result set in Associative arrays

    Post deleted due to formatting/readability issues(Copy and paste from MS-Word isn't working)
    Edited by: user10373231 on Sep 29, 2008 3:27 AM

    the strange thing is, that if I run the same query out of java on MS SQL 2000 it works fine.
    the Stored Procedure fills first a temp table and after it selects an InvestmentType and executes a select
    I call the select procedure from a other procedure.
    EXEC PRInvestmentObjectList3      
    @cdIdentifier=@cdIdent,
    @idIdentifierSystem=@idIdentSystem
    the case is that PRInvestmentObjectList3 is from a product which we have bought and therefore we do not reference directly on this Stored Procedure in our Java Code.
    So we have a own made Stored Proc which only calls this SP.
    I use the same statement for the query on MS SQL 2000 and MS SQL 2005 I change only the database.
    Edit:
    If I execute another statement which also retuns a row with many columns in the Management Studio, I get the same error...
    The result in the Managment Studio is something like this:
    idInvestmentObject tyInvestmentObject ......
    34802 1 ...... etc
    thx.
    Sterbsli
    Edited by: Sterbsli on Jul 21, 2008 11:42 PM
    Edited by: Sterbsli on Jul 22, 2008 1:59 AM

  • Create tabs from database retrieval result set?

    Trying to figure out how to dynamically create tabs based on a database result set....
    for example when page launches, a db connection starts, and a query is made to retrieve say, distinct colors available in a db table, and a tab page is generated for each color found... is there a way to do this?
    Thanks for any advice or assistance. Example would be big help.

    Thanks for the link, I think I'd read that before, but wasn't too sure how I could adapt it to create tabs... not sure where to find the method references to the tabset or tab components to call... any tips or examples would be useful. Thanks!

  • Getting result set from stored procedures in database controls in weblogic

    I am calling a stored procedure from database control which actually returns a result set
    when i call the stored procedure like
    * @jc:sql statement="call PROC4()"
    ResultSet sampleProc() throws SQLException;
    it gives me exception saying
    "weblogic.jws.control.ControlException: Method sampleProc is DML but does not return void or int"
    I would appreciate any help
    Thanks,
    Uma

    Thanks for you reply!
    1) The stored procedure has head
    CREATE OR REPLACE PROCEDURE X_OWNER.DISPLAY_ADDRESS
    cv_1 IN OUT SYS_REFCURSOR
    AS
    err_msg VARCHAR2(100);
    BEGIN
    --Adaptive Server has expanded all '*' elements in the following statement
    OPEN cv_1 FOR
    Select ...
    commit;
    EXCEPTION
    WHEN OTHERS THEN
    err_msg := SQLERRM;
    dbms_output.put_line (err_msg);
    ROLLBACK;
    END;
    If I only run select .. in DBArtisan, it display all 2030,000 rows in 3:44 minutes
    2) But when call stored procedure, it will take 80-100 minutes .
    3) The stored procedure is translated from sybase using migration tools, it's very simple, in sybase it just
    CREATE PROCEDURE X_OWNER.DISPLAY_ADDRESS
    AS
    BEGIN
    select ..
    The select part is exact same.
    4) The perl code is almost exact same, except the query sql:
    sybase verson: my $sql ="exec DISPLAY_ADDRESS";
    and no need bind the cursor parameter.
    This is batch job, we create a file with all information, and ftp to clients everynight.
    Thanks!
    Rulin

  • Which is more efficient way to get result set from database server

    Hi,
    I am working on a project where I require to query database to fetch result set and then iterate through the resultset. Now, What I want is that I want to create one single java code that would call many different SQLs and create a list out of resultset. There are two approaches for me.
    1.) To create a txt file where I can store my queries. My java program can read this file and get the appropriate query to be used.
    2.) To create a stored procedure containing the queries and call the stored procedure from my java program. Also, not that some of the queries needs to be created dynamically depending upon the parameteters supplied.
    Out of these two approches which is optimum and why?
    Also, following things to be noted.
    1. At times I want to create where clause of the query dynamically depenending upon the parameters passed.
    2. I want one single java file that will handle all database calls.
    3. Paramters to the stored procedure can be passed using array descriptor.
    4. Conneciton I am making using JNDI.
    Please do provide me optimum way of out these two. You may also suggest some other approaches, if any.
    Thanks,
    Rajan
    Edited by: RP on Jun 26, 2012 11:11 PM

    RP wrote:
    In case of queries stored in text files. I will require to replace some pre defined placeholder with actual parameters and then pass that modified query to db engine. Even I liked the second approach as it is more easily maintainable. There are a couple of issues. Shared SQL is one. Irrespective of the method used, the SQL cursor that is created needs to have bind variables. This ensures re-usability of the cursor. This reduces the risk of Shared Pool fragmentation. This lowers hard parsing and reduces CPU utilisation.
    Another issue is flexibility. If the SQL cursors are created by stored procedures, this code resides on the server and abstracts the Java client from the complexities of SQL and SQL performance. The code can easily be updated and fine tuned to deliver faster/better SQL cursors, or modified to take new Oracle features, changes in data model, and so on, into consideration. This stored proc can be updated without having to touch or recompile a single byte of Java client code.
    There's also the security issue. What is more secure? SQL encapsulated in stored procs in a secure database and server environment? Or SQL "encapsulated" in text files on the client?
    The less code you have running on the client, the less code you have running in the wild that can be compromised without having to first compromise the server.
    Only I was worried about any performace issue might happen using this approach. Performance is not a factor of who creates the SQL cursor.
    Whether Java client creates a SQL cursor, or a PL/SQL stored proc creates a SQL cursor, or a .Net client creates a SQL cursor - that SQL cursor does not know what the client is. It does not care what the client is. The SQL cursor performs as well as it is capable of.. given the execution plan, data volumes, server resources and speed/performance of the server.
    The client language and SQL cursor interface used by the client (there are several in PL/SQL), determines the performance of the client's interaction with the cursor (e.g. round trips to the database when interfacing with the cursor). The client language (and its client interface to the cursor) does not dictate the actual performance of that SQL cursor on the database (does not make joins faster, or I/O faster)
    One more question, Will my java program close the cursor that I opened in Procedure?That you need to ask your Java code. Java code leaking ref cursors are unfortunately all too common. You need to make sure that your Java client interface to SQL cursors, closes the cursor handle when done.

  • JDBC SQL Server Channel Calling Stored Procedure Won't Return Result Set

    Good afternoon, Experts
    We're calling a stored procedure in a sender communcation channel.  I can perform any SQL SELECT statement here, but for some reason when I execute the SP (EXECUTE StoredProcedureName) The Adapter Engine returns the following:
    Database-level error reported by JDBC driver while executing statement 'DECLARE @UpdateRecords bit SET @UpdateRecords = 0 EXECUTE ExportToSAP @UpdateRecords'. The JDBC driver returned the following error message: 'com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.'. For details, contact your database server vendor.
    Even stranger yet is is that this works just fine on our PI-DEV system.  I created an identical communication channel connecting to the same database with the same UID and PWD and it won't work in PI-QAS.
    Any help/ideas you could share would be greatly appreciated!!!
    Thanks,
    Chad

    Hi Chad.
    Normally, itu2019s a problem with your procedure. The Store Procedure is wrong and something is different between your DEV environment and QAS environment.
    Try to ask to DB team check it.
    Regards,
    Bruno

  • How to use stored procedure which returns result set in OBIEE

    Hi,
    I hav one stored procedure (one parameter) which returns a result set. Can we use this stored procedure in OBIEE? If so, how we hav to use.
    I know we hav the Evaluate function but not sure whether I can use for my SP which returns result set. Is there any other way where I can use my SP?
    Pls help me in solving this.
    Thanks

    Hi Radha,
    If you want to cache the results in the Oracle BI Server, you should check that option. When you run a query the Oracle BI Server will get its results from the cache, based on the persistence time you define. If the cache is expired, the Oracle BI Server will go to the database to get the results.
    If you want to use caching, you should enable caching in the nqsconfig.ini file.
    Cheers,
    Daan Bakboord

  • Database control: how to read output of sproc that returns result set

    I have a stored procedure that returns a result set. Should I use a RowSet control to wrap this, or a database control, or neither? Am I better off with straight JDBC in a Java control?
    Thanks.

    Sorry for missing the point totally...
    DOKTL also contains long text for FM parameters...
    This is a modified version of your code that retrieves the long text and displays it...
    DATA: parameter TYPE TABLE OF swotfupar,
          ls_parameter LIKE LINE OF parameter,
          search_string TYPE doktl-object,
          texttab type table of doktl-doktext with header line.
    PARAMETERS: fubaname TYPE swcontdef-abapname
                              DEFAULT 'POPUP_TO_CONFIRM',
                pa_lang TYPE sy-langu.
    START-OF-SELECTION.
      CALL FUNCTION 'SWO_QUERY_FUNCTION_PARAMETERS'
        EXPORTING
          functionmodule            = fubaname
        TABLES
          function_parameters       = parameter
    *   EXCEPTIONS
    *     FUNCTION_NOT_FOUND        = 1
    *     OTHERS                    = 2
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT parameter INTO ls_parameter.
        CONCATENATE `                              `            "30 spaces
                    ls_parameter-parameter INTO search_string.
        OVERLAY search_string WITH fubaname.
        SELECT doktext FROM doktl INTO TABLE texttab
               WHERE id = 'FU'
               AND langu = pa_lang
               AND object = search_string.
        WRITE:/ 'Long Text for', ls_parameter-parameter.
        LOOP AT texttab.
          NEW-LINE.
          WRITE: AT 10 texttab COLOR COL_HEADING.
        ENDLOOP.
      ENDLOOP.
    Hope this helps you
    Regards,
    Dushyant Shetty

  • Stored function not returning result set unless recompiled

    Hi,
    I have a strange situation going on with a basic Java (1.6.0.17) application talking to an Oracle 11g (11.2.0.1.0) database. Basically what is happening is that sometimes a stored function's return value (a result set) is not making it as far as JDBC/Java, unless I recompile the stored function (with absolutely no changes to the application or function's code). I am always able to successfully see the result set if I call the function directly from within SQL Developer, just not on the Java app/JDBC side.
    I've tried running with 3 different physical Oracle 11g servers and tried running the app on a couple of machines. I'm wondering if this is either some kind of caching issue or perhaps a JDBC bug/misconfiguration.
    Any help would be greatly appreciated. Attached to this message:
    1. stored function code
    2. snippet of Java app code
    3. ODBC trace output when returned a empty result set (ie failure scenario)
    4. ODBC trace out when returned the correct result set (ie success scenario)
    * it's helpful if you compare the texts of 3 & 4 with Vim diff or WinMerge etc.
    ** as they're large I've just extracted the sections that had differences. Leave a message here and I can send you the full ones if necessary.
    1. stored function code
    ===============
    FUNCTION getRecordSet (
    ActionId Number
    RETURN CallingList.ref_cursor
    IS
    myDataCursor CallingList.ref_cursor;
    ActionId_ Number;
    BEGIN
    ActionId_ := ActionId;
    IF isActionExpired(ActionId) <= 0 THEN
    ActionId_ := 0;
    END IF;
    OPEN myDataCursor FOR
    SELECT
    C.ID,
    C.CUSTOMER_ID,
    C.CAMPAIGN_ID,
    c.phone,
    C.TRANSFERDN,
    (SELECT
    TTS_MESSAGE
    FROM CAMPAIGN CMP
    WHERE CMP.CAMPAIGN_ID = C.CAMPAIGN_ID) "TTS"
    FROM
    CALLING_LIST C
    WHERE
    C.ACTION_ID = ActionId_
    AND
    C.CALL_STATUS = 1
    AND
    C.CALLCOUNT > 0
    And rownum <=5;
    RETURN myDataCursor;
    EXCEPTION
    WHEN CURSOR_ALREADY_OPEN THEN
    RETURN NULL;
    WHEN INVALID_CURSOR THEN
    RETURN NULL;
    WHEN NO_DATA_FOUND THEN
    RETURN NULL;
    END getRecordSet;
    ....and the isActionExpired function that is called from within getResultSet is (but for all my testing it's been returning 1 with no problems)
    FUNCTION isActionExpired (
    ActionId number
    ) RETURN number
    AS
    Today varchar2(12);
    myCount number(6);
    BEGIN
    myCount := 0;
    today := to_char(sysdate, 'dd.mm.yyyy');
    SELECT
    count(*)
    INTO
    myCount
    FROM
    ACTION A
    where
    ACTION_ID = ActionId
    AND
    SYSDATE BETWEEN ACTION_STARTDATETIME
    AND
    ACTION_STOPDATETIME
    and
    SYSDATE BETWEEN to_date(today || ' ' || A.STARTTIME, 'dd.mm.yyyy HH24:MI:SS') and to_date(today || ' ' || A.ENDTIME, 'dd.mm.yyyy HH24:MI:SS')
    AND
    ACTION_STATUS = 1;
    return myCount;
    END isActionExpired;
    2. snippet of Java app code
    =================
    ... db connect logic...
    javax.management.MBeanServer mbs = null;
    javax.management.ObjectName name = null;
    try {
    String loader = Thread.currentThread().getContextClassLoader().toString().replaceAll("[,=:\"]+", "");
    name = new javax.management.ObjectName("com.oracle.jdbc:type=diagnosability,name="+loader);
    mbs = java.lang.management.ManagementFactory.getPlatformMBeanServer();
    mbs.setAttribute(name, new javax.management.Attribute("LoggingEnabled", true));
    } catch (Exception e) {
    System.out.println("ORACLE TRACE ERROR: " + e.getStackTrace());
    try {
    String query = "begin ? := CALLINGLIST.getRecordSet(?); end;";
    CallableStatement stmt = conn.prepareCall(query);
    stmt.registerOutParameter(1, OracleTypes.CURSOR);
    stmt.setInt(2, actionId);
    stmt.execute();
    ResultSet rs = (ResultSet) stmt.getObject(1); // So, here it works.
    // print the results
    int count=0;
    while (rs.next()) {
    count++;
    stmt.close();
    System.out.println("rs count was: " + count);
    } catch (SQLException e) {
    System.out.println("Exception occurred: " + e.getMessage());
    3. ODBC trace output when returned a empty result set (ie failure scenario)
    ===============================================
    Jul 1, 2010 3:30:47 PM oracle.net.ns.Packet receive
    TRACE_16: Enter:
    Jul 1, 2010 3:30:47 PM oracle.net.ns.Packet receive
    TRACE_20: Debug: type=6, length=121, flags=0
    00 79 00 00 06 00 00 00 |.y......|
    00 00 06 22 01 06 00 01 |..."....|
    0A 00 00 00 07 03 C2 04 |........|
    0E 04 C3 5E 22 03 02 C1 |...^"...|
    2A 04 33 30 30 32 03 37 |*.3002.7|
    37 37 05 48 65 6C 6C 6F |77.Hello|
    08 01 06 00 00 01 02 00 |........|
    00 00 00 00 00 04 01 05 |........|
    01 01 02 05 7B 00 00 01 |....{...|
    02 00 03 00 00 00 00 00 |........|
    00 00 00 00 00 00 00 00 |........|
    00 01 01 00 00 00 00 19 |........|
    4F 52 41 2D 30 31 34 30 |ORA-0140|
    33 3A 20 6E 6F 20 64 61 |3:.no.da|
    74 61 20 66 6F 75 6E 64 |ta.found|
    0A |. |
    Jul 1, 2010 3:30:47 PM oracle.net.ns.Packet receive
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
    TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 1, [I@1315d34, 20
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
    TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 1, 871, [I@1315d34, 20, oracle-character-set-830, oracle-character-set-2000, oracle-character-set-871, false
    Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
    TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 1, [I@1315d34, true, 20
    Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
    TRACE_16: return: 4
    Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
    TRACE_16: return: 4
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
    TRACE_16: return: 4
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
    TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 211, [I@1de256f, 10
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
    TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 211, 871, [I@1de256f, 10, oracle-character-set-830, oracle-character-set-2000, oracle-character-set-871, false
    Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
    TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 211, [I@1de256f, true, 10
    Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
    TRACE_16: return: 3
    Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
    TRACE_16: return: 3
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
    TRACE_16: return: 3
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
    TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 321, [I@16bd8ea, 2000
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
    TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 321, 871, [I@16bd8ea, 2000, oracle-character-set-830, oracle-character-set-2000, oracle-character-set-871, false
    Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
    TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 321, [I@16bd8ea, true, 2000
    Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
    TRACE_16: return: 5
    Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
    TRACE_16: return: 5
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
    TRACE_16: return: 5
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CConnection updateSessionProperties
    TRACE_16: Enter: [Loracle.jdbc.internal.KeywordValue;@16e1fb1
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CConnection updateSessionProperties
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CStatement fetch
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement checkValidRowsStatus
    TRACE_16: Enter:
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement checkValidRowsStatus
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl <init>
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CResultSetAccessor getCursor
    TRACE_16: return: oracle.jdbc.driver.OracleResultSetImpl@e2cb55
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CResultSetAccessor getCursor
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.ResultSetAccessor getObject
    TRACE_16: return: oracle.jdbc.driver.OracleResultSetImpl@e2cb55
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.ResultSetAccessor getObject
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleCallableStatement getObject
    TRACE_1: return: oracle.jdbc.driver.OracleResultSetImpl@e2cb55
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleCallableStatement getObject
    TRACE_1: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleCallableStatementWrapper getObject
    TRACE_30: return: oracle.jdbc.driver.OracleResultSetImpl@e2cb55
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleCallableStatementWrapper getObject
    TRACE_30: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
    TRACE_1: Public Enter:
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
    TRACE_20: Debug: closed=false, statement.currentRow=-1, statement.totalRowsVisited=0, statement.maxRows=0, statement.validRows=1, statement.gotLastBatch=true
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
    TRACE_1: return: true
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
    TRACE_1: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
    TRACE_1: Public Enter:
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
    TRACE_20: Debug: closed=false, statement.currentRow=0, statement.totalRowsVisited=1, statement.maxRows=0, statement.validRows=1, statement.gotLastBatch=true
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
    TRACE_16: Enter: false
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BaseResultSet close
    TRACE_16: Public Enter:
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BaseResultSet close
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection registerHeartbeat
    TRACE_16: Enter:
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection registerHeartbeat
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection needLine
    TRACE_16: Enter:
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection needLineUnchecked
    TRACE_16: Enter:
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection needLineUnchecked
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection needLine
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CStatement closeQuery
    TRACE_16: Enter:
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CConnection assertLoggedOn
    TRACE_16: Enter: "oracle.jdbc.driver.T4CStatement.closeQuery"
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CConnection assertLoggedOn
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CStatement closeQuery
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement endOfResultSet
    TRACE_16: Enter: false
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement prepareForNewResults
    TRACE_16: Enter: false, false
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement clearWarnings
    TRACE_16: Public Enter:
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement clearWarnings
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
    TRACE_16: Enter: true
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
    TRACE_16: return:
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement prepareForNewResults
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CStatement clearDefines
    TRACE_16: Enter:
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement clearDefines
    TRACE_16: Public Enter:
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement freeLine
    TRACE_16: Enter:
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement freeLine
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement cleanupDefines
    TRACE_16: Enter:
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
    TRACE_16: Enter: [B@8e32e7
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BufferCache put
    TRACE_16: Enter: [B@8e32e7
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BufferCache put
    TRACE_30: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
    TRACE_16: Enter: [C@1b000e7
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BufferCache put
    TRACE_16: Enter: [C@1b000e7
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BufferCache put
    TRACE_30: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement cleanupDefines
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement clearDefines
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CStatement clearDefines
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement endOfResultSet
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
    TRACE_16: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
    TRACE_1: return: false
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
    TRACE_1: Exit
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleCallableStatementWrapper close
    TRACE_16: Enter:
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OraclePreparedStatementWrapper close
    TRACE_16: Enter:
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatementWrapper close
    TRACE_16: Enter:
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement close
    TRACE_1: Public Enter:
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement closeOrCache
    TRACE_16: Enter: null
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection isStatementCacheInitialized
    TRACE_16: Enter:
    Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection isStatementCacheInitialized
    4. ODBC trace out when returned the correct result set (ie success scenario)
    ===============================================
    TRACE_16: Enter:
    Jul 1, 2010 3:30:07 PM oracle.net.ns.Packet receive
    TRACE_20: Debug: type=6, length=82, flags=0
    00 52 00 00 06 00 00 00    |.R......|
    00 00 08 01 06 00 00 01    |........|
    02 00 00 00 00 00 00 04    |........|
    01 05 00 02 05 7B 00 00    |.....{..|
    01 02 00 03 00 00 00 00    |........|
    00 00 00 00 00 00 00 00    |........|
    00 00 01 01 00 00 00 00    |........|
    19 4F 52 41 2D 30 31 34    |.ORA-014|
    30 33 3A 20 6E 6F 20 64    |03:.no.d|
    61 74 61 20 66 6F 75 6E    |ata.foun|
    64 0A                      |d.      |
    Jul 1, 2010 3:30:07 PM oracle.net.ns.Packet receive
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CConnection updateSessionProperties
    TRACE_16: Enter: [Loracle.jdbc.internal.KeywordValue;@1fa1bb6
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CConnection updateSessionProperties
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CStatement fetch
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
    TRACE_16: Enter: false
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BaseResultSet close
    TRACE_16: Public Enter:
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BaseResultSet close
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection registerHeartbeat
    TRACE_16: Enter:
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection registerHeartbeat
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection needLine
    TRACE_16: Enter:
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection needLineUnchecked
    TRACE_16: Enter:
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection needLineUnchecked
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection needLine
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CStatement closeQuery
    TRACE_16: Enter:
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CConnection assertLoggedOn
    TRACE_16: Enter: "oracle.jdbc.driver.T4CStatement.closeQuery"
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CConnection assertLoggedOn
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CStatement closeQuery
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement endOfResultSet
    TRACE_16: Enter: false
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement prepareForNewResults
    TRACE_16: Enter: false, false
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement clearWarnings
    TRACE_16: Public Enter:
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement clearWarnings
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement prepareForNewResults
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CStatement clearDefines
    TRACE_16: Enter:
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement clearDefines
    TRACE_16: Public Enter:
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement freeLine
    TRACE_16: Enter:
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement freeLine
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement cleanupDefines
    TRACE_16: Enter:
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
    TRACE_16: Enter: [B@8e32e7
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BufferCache put
    TRACE_16: Enter: [B@8e32e7
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BufferCache put
    TRACE_30: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
    TRACE_16: Enter: [C@1b000e7
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BufferCache put
    TRACE_16: Enter: [C@1b000e7
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BufferCache put
    TRACE_30: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement cleanupDefines
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement clearDefines
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CStatement clearDefines
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement endOfResultSet
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl <init>
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CResultSetAccessor getCursor
    TRACE_16: return: oracle.jdbc.driver.OracleResultSetImpl@1315d34
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CResultSetAccessor getCursor
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.ResultSetAccessor getObject
    TRACE_16: return: oracle.jdbc.driver.OracleResultSetImpl@1315d34
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.ResultSetAccessor getObject
    TRACE_16: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleCallableStatement getObject
    TRACE_1: return: oracle.jdbc.driver.OracleResultSetImpl@1315d34
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleCallableStatement getObject
    TRACE_1: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleCallableStatementWrapper getObject
    TRACE_30: return: oracle.jdbc.driver.OracleResultSetImpl@1315d34
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleCallableStatementWrapper getObject
    TRACE_30: Exit
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl next
    TRACE_1: Public Enter:
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl next
    TRACE_20: Debug: closed=true, statement.currentRow=-1, statement.totalRowsVisited=0, statement.maxRows=0, statement.validRows=0, statement.gotLastBatch=false
    Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl next
    Edited by: user9376621 on Jul 1, 2010 1:07 AM
    Edited by: user9376621 on Jul 1, 2010 1:13 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         

    Please ignore this, it was a non-issue in the end.

  • Performance to fetch result set from stored procedure.

    I read some of related threads, but couldn't find any good suggestions about the performance issue to fetch the result set from a stored procedure.
    Here is my case:
    I have a stored procedure which will return 2,030,000 rows. When I run the select part only in the dbartisan, it takes about 3 minutes, so I know it's not query problem. But when I call the stored procedure in DBArtisan in following way:
    declare cr SYS_REFCURSOR;
    firstname char(20);
    lastname char(20);
    street char(40);
    city char(20);
    STATE varchar2(2);
    begin DISPLAY_ADDRESS(cr);
    DBMS_OUTPUT.ENABLE(null);
    LOOP
    FETCH cr INTO firstname,lastname,street, city, state;
    EXIT WHEN cr%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE( firstname||','|| lastname||','|| street||',' ||city||',' ||STATE);
    END LOOP;
    CLOSE cr;
    end;
    It will take about 100 minutes. When I used DBI fetchrow_array in perl code, it took about same amount of time. However, same stored procedure in sybase without using cursor, and same perl code, it only takes 12 minutes to display all results. We assume oracle has better performance. So what could be the problem here?
    The perl code:
    my $dbh = DBI->connect($databaseserver, $dbuser, $dbpassword,
    { 'AutoCommit' => 0,'RaiseError' => 1, 'PrintError' => 0 })
    or die "couldn't connect to database: " . DBI->errstr;
    open OUTPUTFILE, ">$temp_output_path";
    my $rc;
    my $sql="BEGIN DISPLAY_ADDRESS(:rc); END;";
    my $sth = $dbh->prepare($sql) or die "Couldn't prepare statement: " . $dbh->errstr;
    $sth->bind_param_inout(':rc', \$rc, 0, { ora_type=> ORA_RSET });
    $sth->execute() or die "Couldn't execute statement: " . $sth->errstr;
    while($address_info=$rc->fetchrow_arrayref()){
    my ($firstname, $lastname, $street, $city, $STATE) = @$address_info;
    print OUTPUTFILE $firstname."|".$lastname."|".$street."|".$city."|".$STATE;
    $dbh->commit();
    $dbh->disconnect();
    close OUTPUTFILE;
    Thanks!
    rulin

    Thanks for you reply!
    1) The stored procedure has head
    CREATE OR REPLACE PROCEDURE X_OWNER.DISPLAY_ADDRESS
    cv_1 IN OUT SYS_REFCURSOR
    AS
    err_msg VARCHAR2(100);
    BEGIN
    --Adaptive Server has expanded all '*' elements in the following statement
    OPEN cv_1 FOR
    Select ...
    commit;
    EXCEPTION
    WHEN OTHERS THEN
    err_msg := SQLERRM;
    dbms_output.put_line (err_msg);
    ROLLBACK;
    END;
    If I only run select .. in DBArtisan, it display all 2030,000 rows in 3:44 minutes
    2) But when call stored procedure, it will take 80-100 minutes .
    3) The stored procedure is translated from sybase using migration tools, it's very simple, in sybase it just
    CREATE PROCEDURE X_OWNER.DISPLAY_ADDRESS
    AS
    BEGIN
    select ..
    The select part is exact same.
    4) The perl code is almost exact same, except the query sql:
    sybase verson: my $sql ="exec DISPLAY_ADDRESS";
    and no need bind the cursor parameter.
    This is batch job, we create a file with all information, and ftp to clients everynight.
    Thanks!
    Rulin

  • Stored Procedure With Multiple Result Sets As Report Source : Crosspost

    Hello Everyone,
    I have an issue where i have created a stored procedure that returns multiple result sets
    /* Input param = @SalesOrderID */
    SELECT * FROM Orders TB1
      INNER JOIN OrderDetails TB2 ON  TB1.ID = TB2.ID
    WHERE TB1.OrderID = @SalesOrderID
    SELECT * FROM Addresses
      WHERE Addresses.OrderID = @SalesOrderID AND Addresses.AddressType = 'Shipping'
    SELECT * FROM Addresses
      WHERE Addresses.OrderID = @SalesOrderID AND Addresses.AddressType = 'Billing'
    This is just a quick sample, the actual procedure is a lot more complex but this illustrates the theory.
    When I set the report source in Crystal X to the stored procedure it is only allowing me to add rows from the first result set.
    Is there any way to get around this issue?
    The reason that I would prefer to use a stored procedure to get all the data is simply performance. Without using one big stored procedure I would have to run at least 6 sub reports which is not acceptable because the number of sub reports could grow exponentially depending on the number of items for a particular sales order.
    Any ideas or input would be greatly appreciated.
    TIA
        - Adam
    P.S
    Sorry for the cross post, I originally posted this question [here|/community [original link is broken];
    but was informed that it might be the wrong forum
    Edited by: Adam Harris on Jul 30, 2008 9:44 PM

    Adam, apologies for the redirect, but it is better to have .NET posts in one place. That way anyone can search the forum for answers. (and I do not have the rights to move posts).
    Anyhow, as long as the report is created, you should be able to pass the datasets as:
    crReportDocument.Database.Tables(0).SetDataSource(dataSet.Tables("NAME_OF_TABLE"))
    Of course alternatively, (not sure if this is possible in your environment) you could create a multi-table ADO .NET dataset and pass that to the report.
    Ludek

Maybe you are looking for

  • How do I delete an event in iCal on my MacBook Pro?

    Finally just switched from frustrating google calendar to iCal. Know how to delete events fr iPhone iCal. How do I do on my MacBook Pro?

  • Date issue when exporting data to Excel from SSRS report, where date is less than 1/1/1900

    Hi, I am using SSRS report to display the data from database. In that data, One of the column is DATE. when I am exporting to Excel all that dates are displaying fine except 1/1/1800 12:00 AM. Instead of 1/1/1800 12:00 AM it is displaying XXXXXXXXXXX

  • Switching Ipod from windows to mac without losing all data

    Please help. I set up my Ipod last year with windows computer, downloaded most of my CD's and lots of other music, last month laptop was stolen and I decided to buy a macbook as replacment. I would like to transfer all songs from IPOD to new itunes l

  • Pls don't beat me again, ora-06508

    Hi, expert: First, I would like to thank cordially all the helpers who share their valuable ideas with me. Recently, almost everyday, we get ora-06508 after oracle 8.1.6 and tomcat are running for some time on the NT4 server. All objects are compiled

  • ANN : New Oracle XDK 10g Sample Application

    Hello, Check out this new Oracle XDK 10g Sample Application at http://otn.oracle.com/sample_code/tech/xml/index.html that demonstrates the Unicode Support of XDK using the scenario of a Real Estate Portal. This sample application also discusses the X