Home » ADF » ADF Tuts: Passing comma separated values as Bind variable for View Object Query IN operator.
ADF Tuts: Passing comma separated values as Bind variable for View Object Query IN operator.

ADF Tuts: Passing comma separated values as Bind variable for View Object Query IN operator.

It’s very common use case where we want to pass comma separated value for WHERE clause as IN operator. Today I will explain in very simple way to overcome this issue. Here I am using very simple function INSTR in place of IN operator.

Let’s take an example. Create a View Object using Employees table with following query.

select employee_id,first_name,last_name,email,phone_number
from employees
where INSTR(:str,employee_id)<>0

In following example, I have using bind variable STR which contains comma separated value.

 

pic_1

 

Run Application Module to Check Query Result

pic_2

 

Check out query Result.

pic_3

 

About Manish Pandey

Manish Pandey is a Senior Developer with more than 3 years of experience in JAVA Programming. Currently enhancing skills in ADF.

2 comments

  1. Thanx Manish for this post.

  2. Mayuri Wankhade

    Hey Manish,

    Thanks …
    This post was really helpful and this was the smartest way of doing this ..

Leave a Reply

Your email address will not be published. Required fields are marked *

*

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=""> <s> <strike> <strong>