Q.accrept any string having any no.of comma in the string and display all the words seperated by commas in seperate lin开发者_如何转开发es?
example: delhi,mumbai,pune,puri
i want output like this
outpt: delhi mumbai pune puri
from here
DECLARE
lv_Str_List VARCHAR2(1000) := 'delhi,mumbai,pune,puri';
lb_cnt BINARY_INTEGER;
la_Tab_Str DBMS_UTILITY.UNCL_ARRAY;
BEGIN
-- parse the string into comma separated table
DBMS_UTILITY.COMMA_TO_TABLE(lv_Str_List, lb_cnt, la_Tab_Str);
FOR i IN 1 .. la_Tab_Str.COUNT LOOP
-- display substring
DBMS_OUTPUT.PUT_LINE(TRIM(la_Tab_Str(i)));
END LOOP;
END;
/
精彩评论