Oracle在另一个过程中调用返回CURSOR的过程

时间:2014-08-21 12:49:26

标签: stored-procedures oracle11g cursor sys-refcursor

我有2个包和一个返回sysref游标的过程。现在我想调用另一个包和过程中的2个包和过程中的任何一个,它将在输入列上决定需要调用哪一个。

然而,

因此内部proc的输出必须作为外部proc的输出。如果你能做到这一点,请你点亮一下......

CREATE OR REPLACE PACKAGE DEDUPE_PACKAGE_abc IS
  TYPE refCursor IS REF CURSOR;
  PROCEDURE ADD_CAF_abc(
 IN_CUSTOMER_TYPE         IN VARCHAR2 ,
 retCursor_abc  IN OUT refCursor );

CREATE OR REPLACE PACKAGE DEDUPE_PACKAGE_pqr IS
  TYPE refCursor IS REF CURSOR;
  PROCEDURE ADD_CAF_prq(
 IN_CUSTOMER_TYPE         IN VARCHAR2 ,
 retCursor_pqr  IN OUT refCursor );


CREATE OR REPLACE PACKAGE DEDUPE_PACKAGE_main IS
  TYPE refCursor IS REF CURSOR;
  PROCEDURE ADD_CAF_main(
 IN_CUSTOMER_TYPE         IN VARCHAR2 ,
 retCursor_main  IN OUT refCursor );

BEGIN

if IN_CUSTOMER_TYPE == something then
   exec  dedupe_package_abc.ADD_CAF_abc ; 
   -- i need the output of the cursor here
    return ; 
else  IN_CUSTOMER_TYPE == something2 then
   exec  dedupe_package_pqr.ADD_CAF_pqr ; 
   -- i need the output of the cursor here
    return ; 

return -- i need to return the data from the retcursor_abc or the retcursor_pqr into the retrursor_main ...

0 个答案:

没有答案