Hi I have a requirement when I get a list of values โโfor an input parameter in a PL / SQL procedure. The size of the input list depends on the dynamic. How to cope with 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; /
A type can be declared as "TABLE" 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( PKG_TEST.X('1','2','3','4')); END; /
You can use the varchar parameter in sql, each value should be separated by a comma, something like this: 'Value1, value2, value3, value4, ...,
So you can read the values โโusing split sql function
I hope I understand your question
Source: https://habr.com/ru/post/1525619/More articles:merge acceleration and qi boost - compile-time error - c ++Change NaN to 0 in Javascript - javascriptdelete_form method instead of post method - ruby-on-railsAdd child to DOM table - javascriptResharper to create auto property when creating properties from XAML - c #Gerrit filter for items I need to view - gerritandroid ColorStateList created programmatically and applied to TextColor - androidThe most efficient way to get the N last element of an array is performancesln and vssscc are always in my pending changes to tfs - tfsHow to create source string from string variable in python? - pythonAll Articles