Search notes:

SQL*Plus: REFCURSOR variables

create table tq84_rc_tbl (a number, b varchar2(10));

begin
   insert into tq84_rc_tbl values (1, 'one'  );
   insert into tq84_rc_tbl values (2, 'two'  );
   insert into tq84_rc_tbl values (3, 'three');
   commit;
end;
/

create or replace procedure tq84_rc_proc(rc in out sys_refcursor) as
begin
   open rc for select * from tq84_rc_tbl;
end;
/

variable rc_var refcursor

exec tq84_rc_proc(:rc_var)


print rc_var
--          A B         
-- ---------- ----------
--          1 one       
--          2 two       
--          3 three     

drop procedure tq84_rc_proc;
drop table     tq84_rc_tbl;
Of course, the cursor can also be opened in SQL*Plus with a simple
exec open rc for ‥

See also

SQL*PLus variables
Using ref cursors with Perl DBI

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:51 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(51): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(66): id_of(Object(PDO), 'uri', '/notes/developm...') #2 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1788469533, '216.73.217.21', 'Mozilla/5.0 App...', NULL) #3 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/SQL-Plus/variable/refcursor(71): insert_webrequest() #4 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 51