Hi I have a requirement where I get list of values to a input parameter in PL/SQL procedure. The size of the input list varies which is dynamic. How to handle this requirement any help?
CREATE OR REPLACE PACKAGE PKG_TEST AS
TYPE X IS TABLE OF VARCHAR2(30);
PROCEDURE XYZ(Y IN X);
END PKG_TEST;
/
The type can be declared as "TABLE OF" OR "VARRAY(10)";
CREATE OR REPLACE PACKAGE BODY PKG_TEST AS
PROCEDURE XYZ(Y IN X) AS
BEGIN
FOR I IN Y.FIRST..Y.LAST
LOOP
DBMS_OUTPUT.PUT_LINE('THE VALUE OF I IS'||Y(I));
END LOOP;
END;
END PKG_TEST;
/
DECLARE
BEGIN
PKG_TEST.XYZ('1','2','3','4');
END;
/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With