I have an arraylist of Strings and a string which is the csv format of this list.
I want to write an sql query which refines the result on this list basis.
So, I want something like —
select * from table_name where name in (`ArrayList<String> values` or `csv format string`).
I believe that something like procedure, functions etc. can be made to solve the purpose.
I just want to know how can i achieve this.
Thanks
It’s unclear what exactly you mean by ArrayList; are you talking about a C#/Java/whatever type here (since Oracle PL/SQL doesn’t have Generics)?
Anyway, here is one way to convert a comma-separated list in PL/SQL into a PL/SQL table und use it for an IN search:
(see AskTom)
Usage: