I want to test whether the values in a parameter delimited by a comma is in the column.
Value for :param_ is something like this:
Hi,Hello,World
I want my query to have a result like in this query:
SELECT col FROM tbl1
WHERE col IN ('Hi','Hello','World');
I tried:
SELECT col FROM tbl1
WHERE col IN (
SELECT SUBSTR( SUBSTR('''' || REPLACE(:param_, ',', ''',''') || '''', 1,
LENGTH('''' || REPLACE(:param_, ',', ''',''') || '''') - 1), 2,
LENGTH( SUBSTR('''' || REPLACE(:param_, ',', ''',''') || '''', 1, LENGTH(''''
|| REPLACE(:param_, ',', ''',''') || '''') - 1) ) - 1 )
FROM tbl1);
The subquery in the code that I tried has the output Hi','Hello','World. I removed the first and last single quote because I thought that it will have when it is inputted as a string and will be 'Hi','Hello','World' in the IN clause