Set the REFCURSOR variable to the results of a SELECT statement, and print out the REFCURSOR variable
SQL>
SQL> SET ECHO OFF
SQL>
SQL> VARIABLE l_table_list REFCURSOR
SQL>
SQL>
SQL> BEGIN
2 OPEN :l_table_list FOR
3 SELECT table_name FROM user_tables;
4 END;
5 /
PL/SQL procedure successfully completed.
SQL>
SQL>
SQL> PRINT l_table_list
COURSE
EMP_AUDIT
MYTABLE1
MYLOG
P
SYSTEM_STATS
INVENTORY_TBL
DEPT$AUDIT
PASSWORD_AUDIT
EMP_DELTAS
CUSTLOG
DEMO
CUST_NO_KEY_TABLE
IT
P1
MYSTATS
WORKING_EMPS
WORKING_EMPLOYEES
EMPTEMPTABLE
TEMP_TABLE
EMPLOYEETEMPTABLE
TMP
PARMS
IX
CUST_WITH_VARRAY_TEMP_TABLE
WORKING_CUSTOMERS
26 rows selected.
SQL>
SQL>
SQL>
Related examples in the same category