CREATE TABLE T1
(
DATA VARCHAR2(50)
)
/
INSERT INTO T1 VALUES('GTY');
INSERT INTO T1 VALUES('GAT');
INSERT INTO T1 VALUES('GPL');
SQL> SELECT * FROM T1;
DATA
----------------------------------
GTY
GAT
GPL
SELECT *
FROM T1
WHERE DATA IN
(
SELECT
REGEXP_SUBSTR(:P_COMPANY,'[^;]+', 1, LEVEL)
FROM DUAL
CONNECT BY REGEXP_SUBSTR(:P_COMPANY, '[^;]+', 1, LEVEL)
IS NOT NULL)
/
HTTPS://WWW.ORATABLE.COM/REGEX-SPLIT-COMMA-SEPARATED-STRING/
No comments:
Post a Comment