Home » SQL & PL/SQL » SQL & PL/SQL » Reference Cursors
Reference Cursors [message #226198] Thu, 22 March 2007 16:53 Go to next message
bjayan
Messages: 5
Registered: March 2007
Junior Member
I have a dynamic SQL to be executed in a Cursor. I have declared the cursor of type Reference cursor. I also need to pass a parameter to this cursor. Is it possible?

In the below example how can I pass the employee number as a parameter to the cursor?

eg:
declare
TYPE ref_cur_type IS REF CURSOR;
cur_emp ref_cur_type;
emp_rec emp%rowtype;
begin
l_sql := 'select * from emp where eno = ' || l_eno;
open cur_emp for l_sql;
loop
fetch cur_emp into emp_rec;
...............
end loop;

Regards,
Jayan
Re: Reference Cursors [message #226205 is a reply to message #226198] Thu, 22 March 2007 18:35 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
open l_cursor for select * from EMP where ENO=:X using l_eno


http://asktom.oracle.com/pls/asktom/f?p=100:1:0
Previous Topic: What triggers access a table?
Next Topic: Using BULK COLLECT
Goto Forum:
  


Current Time: Sun Dec 04 00:16:10 CST 2016

Total time taken to generate the page: 0.04423 seconds