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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Why this code is not working (REF CURSOR)?

Re: Why this code is not working (REF CURSOR)?

From: Phil Preen <obiwan-preen_at_maytheforcebewithyou.co.uk>
Date: Tue, 11 Jan 2000 11:42:51 -0000
Message-ID: <947591140.813524@red.parallax.co.uk>

<gmei_at_my-deja.com> wrote in message news:85dkjs$r1r$1_at_nnrp1.deja.com...
> Hi:
>
> I am trying to write a package which will return a record set from
> oracle db.
> I am using REF CURSOR to return a cursor set. But I can not get the data
> from the calling procedure. The data prints correctly in the package,
> but not outside the package.
> Could you tell me what I am doing wrong here?
>

You have already fetched the first row from the cursor in the package function, so your external fetch within the loop will only see the second and subsequent rows (I guess your cursor only returns one row, so you see nothing). So either remove the FETCH from the function, or close the cursor and re-open it again.
It is probably also a good idea to close the cursor when you are finished with it.

Phil. Received on Tue Jan 11 2000 - 05:42:51 CST

Original text of this message

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