関数がコンパイルされると仮定して、次のことを試してください。
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;