How to run the procedure that have array output? [message #673584] |
Mon, 26 November 2018 04:20 |
|
Ican321
Messages: 8 Registered: November 2018
|
Junior Member |
|
|
Hi all,
I need your help how to run the package that have array output ?
in my spec body I have :
create or replace package PKG_tst_array is
TYPE rec_msf_fld IS RECORD
( a varchar2(255),
b VARCHAR2(250),
c VARCHAR2(2000)
);
TYPE TBL_OBJ_MSG IS TABLE OF rec_msf_fld;
procedure process (po_a out TBL_OBJ_MSG
);
end;
-------------------------------------------------
CREATE OR REPLACE package BODY PKG_tst_array IS
procedure process (po_a out TBL_OBJ_MSG
)
IS
l_idx NUMBER :=0;
BEGIN
For CREC in (SELECT AA,BB,CC FROM TMP_TABLE)
)
Loop
l_idx := l_idx+1;
PO_A(l_idx).uw_cd := CREC.AA;
PO_A(l_idx).msg_id := CREC.BB;
PO_A(l_idx).msg_txt := CREC.CC;
end loop;
END;
----------------------------------------------------
How can I run this package? I want to see the value of array using dbms_output.
declare
l_msg SYS_REFCURSOR;
begin
PKG_tst_array.process(l_msg);
dbms_output.put_line ('l_msg = '||l_msg );
end;
Thank you for your help.
|
|
|
|
|
|
|