0

I try to call a procedure from another procedure which returns a cursor as OUT and tries to insert the cursor data into a temp table without success.

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;
4

0 回答 0