I wrote the following in Oracle 11g to separate IN params (I_PRODUCT)and make a query. When I give one parameter as the i_PRODUCT, it is populating some results. When I am inserting multiple comma separated parameters, I am expecting to query one by one and populate the entire result and it is not working.
create or replace PROCEDURE RQUERY
(
I_PRODUCT VARCHAR2
, O_Cursor OUT SYS_REFCURSOR
) AS BEGIN
O_Cursor := NULL;
OPEN O_Cursor for
SELECT * FROM Table1 WHERE
Table1.PRODUCT LIKE ( select regexp_substr(I_PRODUCT,'[^,]+', 1, level) from dual
connect by regexp_substr(I_PRODUCT, '[^,]+', 1, level) is not null);
END RQUERY ;