Thursday, March 10, 2011

Weak Ref Cursor

DECLARE
     rcur_emp  SYS_REFCURSOR;
     PROCEDURE process_emp_cur(rcur_emp IN SYS_REFCURSOR) IS
       l_emp emp%ROWTYPE;
     BEGIN
        dbms_output.put_line('Emp table details');
        loop
            fetch rcur_emp into l_emp;
            exit when rcur_emp%notfound;
            dbms_output.put_line('Empno : '|| l_emp.empno);
            dbms_output.put_line('Ename : '|| l_emp.ename);
        end loop;
     END;
BEGIN
  OPEN rcur_emp FOR select * from emp where rownum < 2;
  process_emp_cur (rcur_emp);
  CLOSE rcur_emp;
END;

No comments:

Post a Comment

External Table

Oracle External Table External tables are defined as tables that do not resides in the database allows you to access data that is stor...