Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to build dynamic query strings in the query using DB adapter 'Pure SQL'

Satya SApr 16 2012 — edited Feb 26 2020
Dear Forum,

I am building an application which will access DB to fetch some result set. The query involves retrieving data from multiple tables(nearly 10 tables). So I have created a DB adapter using 'execute pure sql' option. With this query works fine, but my inputs parameters will vary. So I need to make my query dynamic to append the query strings at runtime depending on the inputs.

For example I have 3 input variables - input1,input2 and input3 (in my request xsd) which are used in the pure sql query. Now if I get a 4th input parameter input4 in the request, I need to append this to query string as 'AND input4=[some value]' at runtime. Otherwise my query should have only 3 parameters. Please suggest how this can be achieved.

Regards,
Satya.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 16 2013
Added on Apr 16 2012
6 comments
1,026 views