Supponendo che la funzione venga compilata, prova:
SELECT *
FROM TABLE(strtokenizer('a,b,c',','));
Riferimento:
La funzione deve essere corretta - usa:
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;