Dear all,
Can i build an sql statement dynamically?
For instance, sub_acc is my table name, and....I need some sql statement (simplified) like this:
'select * from sub_acc where <select-condition>' and the <select-condition> is a long string like 'columnA= valueA and columnB = valueB'. It means that the <select-condition> varies in different situation. Can it be done????
This is becoz i need it in a search account scenario, where i have five condition for the user to choose to search.
If the user search by condition 1 and 3, my sql statement...the <select-condition> will be something like 'column1=valueabc and column3=valuebcd' (valueabc, and valuebcd is passed in as ijn parameter).
Can you get it?
Do you have other approach on doing this???
Plaese do give me some advice asap, ok? Thanks very much!
yukeshean
Can i build an sql statement dynamically?
For instance, sub_acc is my table name, and....I need some sql statement (simplified) like this:
'select * from sub_acc where <select-condition>' and the <select-condition> is a long string like 'columnA= valueA and columnB = valueB'. It means that the <select-condition> varies in different situation. Can it be done????
This is becoz i need it in a search account scenario, where i have five condition for the user to choose to search.
If the user search by condition 1 and 3, my sql statement...the <select-condition> will be something like 'column1=valueabc and column3=valuebcd' (valueabc, and valuebcd is passed in as ijn parameter).
Can you get it?
Do you have other approach on doing this???
Plaese do give me some advice asap, ok? Thanks very much!
yukeshean