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: No more row indicator in OCI for PL/SQL calls???

Re: No more row indicator in OCI for PL/SQL calls???

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 1998/01/28
Message-ID: <34d49907.7807766@192.86.155.100>#1/1

On Tue, 27 Jan 1998 18:36:09 -0600, dave_at_digidem.com wrote:

>In my OCI program i am executing a PL/SQL stored procedure that
>can bring back 0 to many rows of data. Since its a stored procedure
>i have to bind my result set to my programs local variables, then
>call oexec until i don't get any more rows back. For each invocation
>of oexec my locals will get filled with the results.
>
>My question is, how do i know when to stop looping? Does oexec bring
>back some kind of result code when there are no rows returned? Do
>i have to use another function to retrieve the result sets.
>
>I'd use an array of structures to hold my results, but i will not
>know the amount of rows i'll get back. Therefore i can't allocate
>the array. Is this a correct assumption?
>
>Thanks for any help!
>
>-David M Rosner
>-dave_at_digidem.com
>
>-------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet

You cannot 'fetch' from a pl/sql routine. You can return a CURSOR from pl/sql and fetch from it. You'd be using ofen, ofetch or some routine like that to fetch rows from the CURSOR.

check out cursor variables in the pl/sql manual for more info on those. Check out $ORACLE_HOME/rdbms/demo/oci11.c for an OCI example of fetching from cursor variables returned from pl/sql....  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Wed Jan 28 1998 - 00:00:00 CST

Original text of this message

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