SQL Procedure 
Author Message
 SQL Procedure
How can I return result set from a Stored Procedure?  Examples, text ...
anything ... green screen or ODBC
Must I use an INTO statement to run the darned thing ...


Fri, 07 Mar 2003 03:00:00 GMT
 SQL Procedure

   Fazal, if you are talking about Workstation DB2 and the C language, I
believe there are samples in the "sqllib\samples\c" directory.  Look at
files "spclient.sqc" and "spserver.sqc".

Quote:

> How can I return result set from a Stored Procedure?  Examples, text ...
> anything ... green screen or ODBC
> Must I use an INTO statement to run the darned thing ...

--
Larry Menard
IBM Workstation Database (DB2) Performance Team
Defender of Geese and of all things Natural


Sat, 08 Mar 2003 03:00:00 GMT
 SQL Procedure
Hi,

For SQL stored procedures you simply declare a cursor WITH RETURN TO
CALLER
or WITH RETURN TO CLIENT. Then leave the cursor open when you exit the
procedure.
The caller then need to use the ASSOCIATE LOCATOR (or was it CURSOR? I
forgot)
statement to pick up the open cursors.
Note that you should also declare the number of returned result sets in
the header of teh SQL procedure.

Cheers
Serge

--
Visit the DB2 UDB and DB2 Connect Online Support site at:
http://www.ibm.com/software/data/db2/udb/winos2unix/support



Sat, 08 Mar 2003 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. fetching the return value of a sql procedure from another procedure

2. Using IN predicate with V 7 SQL procedure (or other stored procedure types)

3. Convert Dynmaic SQL from MS SQL procedure to PostgreSQL PL/pgsql function

4. SQL procedure call from VB with PL/SQL table (with two fields) as agrument

5. OrindaBuild 4.0 - Writes Java to access Tables, PL/SQL procedures,and Oracle SQL Statements

6. executing dynamic sql statements in a PL/SQL procedure

7. executing dynamic sql statements in a PL/SQL procedure

8. Calling PL/SQL procedures via Dynamic SQL

9. SQL procedures vs SQL functions

10. SQL procedures and dynamic SQL

11. Sending parameters to a sql-procedure in no certain order

12. Big SQL-procedure problem


 
Powered by phpBB® Forum Software