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
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.