Home » SQL & PL/SQL » SQL & PL/SQL » Reference Cursors
Reference Cursors [message #226198] Thu, 22 March 2007 16:53 Go to next message
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?

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

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

Previous Topic: What triggers access a table?
Next Topic: Using BULK COLLECT
Goto Forum:

Current Time: Wed Oct 26 10:39:04 CDT 2016

Total time taken to generate the page: 0.10622 seconds