I'm implementing dynamic search within my application, I have the following options to build a query.
- String concatenation from the user input
- Use multiple Queries, and pull the right query based on the user input
- Use one query, use wild cards for the inputs not given by the user.
eg:
select * from A,B where a.id like nvl( {input}, '%')
and a.id = b.aid
and b.value like nvl({input2},'%');
Because id is a primary key I get the following error in the oracle when tried.