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.

COALESCE-SQL

Coalesce- return the null values from the expression. It works similar to a case statement where if expression 1 is false then goes to expr...