February 9, 2011

REF CURSOR in PL/SQL

Cursor variable which will be assosiated with runtime queries with a result set value passing to the query.
declare


type emp_cur REF CURSOR;  /* Declare the ref cursor */
c_emp emp_cur ;  /*c_emp is the cursor variable */
v_variabe employees.ename%type;

begin
open c_emp for select ename from employees;
loop
fetch c_emp into en;
exit when c_emp%notfound;
dbms_output.put_line(en);
end loop;
close c_emp;
end

No comments:

Post a Comment

Thanks for your comments submitted.,will review and Post soon! by admin.

Redwood Recruiting: the ESS and OSCS index ingest jobs must all succeed, or the data won't load

# Fix of the Day #25: Redwood Recruiting: the ESS and OSCS index ingest jobs must all succeed, or the data won't load Part of my Oracl...