I'm trying to define an SQL stored procedure on DB2 for AIX V7.2 which
returns a result set.  Here's the definition -

CREATE PROCEDURE DBXXX001.SP001TEST
(
        INOUT intab VARCHAR(128)
)
DYNAMIC RESULT SETS 1
LANGUAGE SQL
BEGIN
        DECLARE c01 CURSOR FOR SELECT * FROM DBXXX001.T0010TEST;
        OPEN c01;
END

When I try to call it (I've tried this from ODBC, JDBC, C program using
CLI and Perl script), the SP calls successfully but I get -

(from C with CLI)

CLI0115E Invalid cursor state
CLI0116E Invalid transaction state

when trying to fetch the cursor.

The calling program is careful to set autocommit off.

What am I doing wrong ?

Does anyone have any sample code (both SP and calling program) that they
could share ?

TIA

Phil Nelson

-- 
Philip Nelson <[EMAIL PROTECTED]>
ScotDB Limited

-
:::  When replying to the list, please use 'Reply-All' and make sure
:::  a copy goes to the list ([EMAIL PROTECTED]).
***  To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
***  For more information, check http://www.db2eug.uni.cc

Reply via email to