Home > database >  About the query cursor directly
About the query cursor directly

Time:10-21

Use stored procedures to return a cursor
How to use this the cursor directly query
Realize the select * from cursor
This kind of feeling

CodePudding user response:

Not met the demand, the reference under this post
https://www.jb51.net/article/32447.htm

CodePudding user response:

Dynamic cursor statement to accept, and then into the collection using the
DECLARE
S SYS_REFCURSOR;
The TYPE t IS the TABLE OF test_fan % ROWTYPE;
T1 t;
The BEGIN
DECLARE
PROCEDURE test1 (o_cursor OUT SYS_REFCURSOR) IS
The BEGIN
The OPEN o_cursor FOR
SELECT * FROM test_fan;
The END;
The BEGIN
Test1 (o_cursor=& gt; S);
The FETCH s BULK COLLECT
INTO the t1;
FOR I IN 1.. T1. Count LOOP
Dbms_output. Put_line (t1 (I). The object_name);
END LOOP;
The CLOSE s;
The END;
The END;
Do not know if you want

CodePudding user response:

Learn about the Oracle pipeline function
  • Related