Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: cursor varible
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