问题描述
你好,团队,
首先感谢大家的努力和迅速的回应。
-
我有一个过程 “abc”,它返回sys_refcursor使用DBLINK从另一个数据库获取数据。
现在,我想将所有数据从这个sys_refcursor复制到另一个sys_refcursor (光标到光标分配),并将其返回到第二个过程 “xyz”。
-
创建或替换过程abc(ref_cur out sys_refcursor)
作为
开始
open ref_cur for select * from table_name@dblink_for_another_datab作为e;
结束abc;
-
创建或替换过程xyz(ref_cur out sys_refcursor)
作为
P _ out sys_refcursor;
开始
abc(p_out);
ref_cur := p_out;
-将此ref_cur返回到另一个过程。
结束xyz;
-
How can I 作为sign one cursor to another cursor and then return it to calling procedure.
Ple作为e help.
首先感谢大家的努力和迅速的回应。
-
我有一个过程 “abc”,它返回sys_refcursor使用DBLINK从另一个数据库获取数据。
现在,我想将所有数据从这个sys_refcursor复制到另一个sys_refcursor (光标到光标分配),并将其返回到第二个过程 “xyz”。
-
创建或替换过程abc(ref_cur out sys_refcursor)
作为
开始
open ref_cur for select * from table_name@dblink_for_another_datab作为e;
结束abc;
-
创建或替换过程xyz(ref_cur out sys_refcursor)
作为
P _ out sys_refcursor;
开始
abc(p_out);
ref_cur := p_out;
-将此ref_cur返回到另一个过程。
结束xyz;
-
How can I 作为sign one cursor to another cursor and then return it to calling procedure.
Ple作为e help.
专家解答
为我工作 ....
你需要给我们更多的细节,为什么它不适合你
SQL> create or replace procedure abc(ref_cur out sys_refcursor)
2 as
3 begin
4 open ref_cur for select * from scott.emp;
5 end abc;
6 /
Procedure created.
SQL>
SQL>
SQL> create or replace procedure xyz(ref_cur out sys_refcursor)
2 as
3 p_out sys_refcursor;
4 begin
5 abc(p_out);
6 ref_cur := p_out;
7 end xyz;
8 /
Procedure created.
SQL>
SQL> variable rc refcursor
SQL> exec xyz(:rc);
PL/SQL procedure successfully completed.
SQL> print rc
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7788 SCOTT ANALYST 7566 09-DEC-82 3000 20
7839 KING PRESIDENT 17-NOV-81 5000 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 30
7876 ADAMS CLERK 7788 12-JAN-83 1100 20
7900 JAMES CLERK 7698 03-DEC-81 950 30
7902 FORD ANALYST 7566 03-DEC-81 3000 20
7934 MILLER CLERK 7782 23-JAN-82 1300 10
14 rows selected.
你需要给我们更多的细节,为什么它不适合你
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




