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: cursor varible

Re: cursor varible

From: Ganesh Raja <ganesh_at_gtfs-gulf.com>
Date: 12 Dec 2001 23:08:18 -0800
Message-ID: <a8aed4.0112122308.bab7945@posting.google.com>

winw56_at_yahoo.com (jim) wrote in message news:<6631ab8f.0112121634.6e2a4fa1_at_posting.google.com>...
> hello ...
>
> I have a question about this oracle item "cursor varible" .
> I have read thru the the pl/sql book by oracle, but...the concept escapes me.
> (no souprise there)
> Can any one send me an example of how its used and the results of the
> code???
>
> thanks
> jim agans

Okay Here it comes...

Cursor Variables are also Called ref Cursors and these can be bound to a Dynamic Sql Stmt on the runtime.

The Declaration Goes Like this.

Declare
 Type rc is Ref Cursor;
 cur rc;
Begin
if i=1 then
open rc for select * from emp;
else
open rc for select * from dept;
end if;
Then normal cursor Work here.
Close rc;
End;

HTH Regards,
Ganesh R Received on Thu Dec 13 2001 - 01:08:18 CST

Original text of this message

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