Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: EXEC syntax for SP which returns row set
Mark A wrote:
This post
> Here is a DB2 SP that returns a result set, but has no other input or ouput
> parms:
>
> CREATE PROCEDURE db2inst1.test
> RESULT SETS 1
> LANGUAGE SQL
>
> BEGIN
> DECLARE C1 CURSOR WITH RETURN FOR
> SELECT * from department;
>
> OPEN C1;
>
> END
>
with this post of mine
> I found some DB2 manuals. From a very qick glance, it looks like if you add a DYNAMIC RESULTS SET n clause to the CREATE PROCEDURE, and specify an upper bound n for the number of rows you will get back, and then declare a cursor within the the SP with the syntax WITH RETURN, then exit the SP with that cursor open, then that's what you get back as the result set, right ?
I think I may just try that DB2 certification after all. Wonder if Larry would pay for it :-) Received on Fri Jul 15 2005 - 00:37:06 CDT
![]() |
![]() |