PL/SQL does include a basic one for comma separated lists (DBMS_UTILITY.COMMA_TO_TABLE
).
Example:
DECLARE
lv_tab_length BINARY_INTEGER;
lt_array DBMS_UTILITY.lname_array;
BEGIN
DBMS_UTILITY.COMMA_TO_TABLE( list => 'one,two,three,four'
, tablen => lv_tab_length
, tab => lt_array
);
DBMS_OUTPUT.PUT_LINE( 'lv_tab_length = ['||lv_tab_length||']' );
FOR i IN 1..lv_tab_length
LOOP
DBMS_OUTPUT.PUT_LINE( '['||lt_array( i )||']' );
END LOOP;
END;
/
Or see this Ask Tom link for other ideas...
Ak Tom - "varying elements in IN list"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…