游标中的数据未插入全局临时表中

时间:2019-05-29 11:03:25

标签: oracle oracle11g global-temp-tables

我尝试从另一个过程中调用一个过程,该过程将游标返回为OUT,并尝试将游标数据插入到临时表中而没有成功。

create or replace PROCEDURE test_sp_1
(
    IN_LGVID            VARCHAR2,
    IN_CHNID            NUMBER,
    IN_PGMERCHANTID     VARCHAR2,
    IN_FROMDATE         DATE,
    IN_TODATE           DATE,
    IN_LEGALNAME        VARCHAR2,
    IN_DBANAME          VARCHAR2,
    IN_USERID           NUMBER,


  NEW_OUT_TXNREPOCURSOR OUT SYS_REFCURSOR,
  OUT_STATUSCODE      OUT NUMBER,
  OUT_STATUSDESC      OUT VARCHAR2 
)
AS

l_rec  tmp_emp%rowtype;
l_cur1 sys_refcursor;

BEGIN
   DBMS_OUTPUT.PUT_LINE('Testing');
   PRC_GET_AUTH_TXNS(IN_LGVID,IN_CHNID,NULL,TRUNC(IN_FROMDATE),TRUNC(IN_TODATE),NULL,NULL,'10870',NEW_OUT_TXNREPOCURSOR ,OUT_STATUSCODE,OUT_STATUSDESC);

  l_cur1:=NEW_OUT_TXNREPOCURSOR;

   loop
    fetch l_cur1 into l_rec;
    exit when l_cur1%notfound;
    INSERT INTO TMP_EMP(awlmcc,bsftaxamt) values(l_rec.awlmcc,l_rec.bsftaxamt);
    dbms_output.put_line(l_rec.awlmcc||'='||l_rec.bsftaxamt||'=');
    COMMIT;
   end loop;

END;

0 个答案:

没有答案