Feb 222013
 
select nothing
from   this_table
where  this_should_match_one_item in 
          (:this_comma_separated_string);

no rows selected
Trying to bind a variable in-list is a commonly raised problem in Oracle; 
unfortunately an out-of-the box method isn't supplied.

If you want to bind a list of values to a single variable for an “in” comparison, then you need write a PL/SQL function converting it to an array or parse the string in SQL. Tom Kyte goes into details on how to this here.

Get SQLfail sent to your inbox

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>