Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: EXEC syntax for SP which returns row set

Re: EXEC syntax for SP which returns row set

From: Mark A <nobody_at_nowhere.com>
Date: Thu, 14 Jul 2005 23:43:32 -0600
Message-ID: <zsidnck0Vq-f0ErfRVn-iw@comcast.com>


"Mark Townsend" <markbtownsend_at_comcast.net> wrote in message news:iKSdnT0G0qyV10rfRVn-vw_at_comcast.com...
>
> 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 ?
>

See the SP I posted.

> If so, same basic idea as a refcursor, slightly different sugar is all,
> and possibly a little blurring of the lines between what we would see as a
> function as opposed to the SP. Would be interesting to see what is the
> standard.
>

I think the main difference is what is needed on a command processor to test the SP with a result set in Oracle vs. DB2. A java program handles them in a functionally similar way, but not identical.

> FYI - probably the best source for answers to newbie questions on Oracle
> is probably asktom.oracle.com

Before I posted here, I asked 3 experienced Oracle DBA's in my shop and they did not know the answer. I also spent a lot of time reading the PL/SQL manual and books about PL/SQL. I also did some web searches. So if I had one of the Oracle DBA's with 10 years experience (not newbies) ask the question, would that have been better? Received on Fri Jul 15 2005 - 00:43:32 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US