tyson記事本

Google & man(Unix) are your best friends!

Skip to: Content | Sidebar | Footer

Oracle: Funtion return cursor values

23 November, 2007 (14:35) | Oracle | By: tyson

SQL> — ref cursor
SQL> create or replace package pkg_types as
2 type refcursor is ref cursor;
3 end;
4 /
Package created.SQL> create or replace function f_return_refcursor
2 return pkg_types.refcursor
3 as
4 refcur pkg_types.refcursor;
5 begin
6 open refcur for select * from emp;
7 return refcur;
8 end;
9 /
Function created.

SQL> var cur refcursor
SQL> exec :cur := f_return_refcursor;

PL/SQL procedure successfully completed.

SQL> print cur

Write a comment





For spam filtering purposes, please copy the number 2483 to the field below: