Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2003
    Location
    India
    Posts
    4

    Question Unanswered: How to process resultsets returned by stored procedure?

    I am using DataDirect driver. In the following DB2 SQL stored procedure, I return a resultset.

    create PROCEDURE SP7 ()
    DYNAMIC RESULT SETS 1
    LANGUAGE SQL
    ------------------------------------------------------------------------
    -- SQL Stored Procedure
    ------------------------------------------------------------------------
    BEGIN
    -- Declare cursor
    DECLARE cursor1 CURSOR WITH RETURN
    FOR
    SELECT EMP_SID, DEPTNO, NAME, DESCRIPTION FROM PO_EMP;
    -- Cursor left open for client application
    OPEN cursor1;
    END

    I am not able to get the resultset using the callableStatement prepared. Am I missing anything here?

    Please note that the same code works perfectly fine in MS SQL Server and Sybase. Also, i tried the above SP7 stored procedure with cursor declaration containing "WITH RETURN TO CALLER" and "WITH RETURN TO CLIENT". It still doesnot work!

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Without any of the calling code (your SP looks OK), it is hard to tell what your problem is. I suggest that you look at the sample code, specifically spclient.java, that comes with DB2. It shows how to access single and multiple results sets using jdbc.

    HTH

    Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •