फ़ंक्शन को संकलित मानते हुए, प्रयास करें:
SELECT *
FROM TABLE(strtokenizer('a,b,c',','));
संदर्भ:
फ़ंक्शन को ठीक करने की आवश्यकता है - उपयोग करें:
CREATE OR REPLACE FUNCTION StrTokenizer (string IN VARCHAR2,
delimiter IN VARCHAR2)
RETURN key_value_table AS v_ret key_value_table
BEGIN
SELECT CAST(MULTISET(SELECT LEVEL k,
SUBSTR(STRING_TO_TOKENIZE, DECODE(LEVEL, 1, 1, INSTR(STRING_TO_TOKENIZE, DELIMITER, 1, LEVEL-1)+1),
INSTR(STRING_TO_TOKENIZE, DELIMITER, 1, LEVEL) - DECODE( LEVEL, 1, 1, INSTR(STRING_TO_TOKENIZE, DELIMITER, 1, LEVEL-1)+1)) v
FROM (SELECT string || delimiter AS STRING_TO_TOKENIZE ,
delimiter AS DELIMITER
FROM DUAL)
CONNECT BY INSTR(STRING_TO_TOKENIZE, DELIMITER, 1, LEVEL)>0
ORDER BY level ASC) AS key_value_table)
INTO v_ret
FROM DUAL;
RETURN v_ret;
END;