FUNCTION split_string_cur(in_comma_separated_values IN VARCHAR2) RETURN SYS_REFCURSOR IS
res SYS_REFCURSOR;
BEGIN
OPEN res FOR 'select regexp_substr(:0 ,''[^,]+'', 1, level) as value from dual' || ' connect by regexp_substr(:1 , ''[^,]+'', 1, level) is not null'
USING in_comma_separated_values, in_comma_separated_values;
RETURN res;
END;