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.

  1. select employee_id,first_name,last_name,email,phone_number  
  2. from employees  
  3. where <strong>INSTR(:str,employee_id)<>0</strong>  
  1. select employee_id,first_name,last_name,email,phone_number  
  2. from employees  
  3. where <strong>INSTR(:str,employee_id)<>0</strong>  

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 is a Project Leader at Jagran Prakashan Ltd, focused on Jdeveloper Fusion Web Application(specifically Oracle ADF). He shares his knowledge through the OTN Jdev/ADF Forum. He has written more than 50 article about Oracle ADF and Jdeveloper.

Leave a Reply