My procedure
CREATE OR REPLACE PROCEDURE my_procedure(res OUT SYS_REFCURSOR , p_LstKH CLOB)
AS
CURSOR c_dsKH
IS
SELECT TO_NUMBER(REGEXP_SUBSTR(p_LstKH,'[^,]+', 1, level)) value FROM dual
CONNECT BY REGEXP_SUBSTR(p_LstKH, '[^,]+', 1, level) IS NOT NULL;
BEGIN
...
END;
I would like to split long string p_LstKH and then put into CURSOR c_dsKH. Example: p_LstKH = '1,2,....,10000'
c_dsKH.value
1
2
...
10000
However, when I execute that procedure, I get error "not enough memory for connect by operation". I've try to replace parameter p_LstKH CLOB with p_LstKH VARCHAR2, then I get other error "ORA-06502: PL/SQL: numeric or value error: character string buffer too small".
What should I do now ? Simply, I would like to split a long string. Thanks all !