Data Access Application Block (DAAB) and SQL IN Keyword (Multiple Criteria)

I am using the Pattern and Practice Data Access Application Block and I want to be able to do SELECT using multiple criteria that you can use in SQL using the IN keyword. For example:

SELECT * FROM SomeTable WHERE PrimaryKey IN (@keys)

      

How can I pass @keys values? I don't want to dynamically build my SQL.

I'm querying an Oracle database.

Also, is there another way to make such a query more DAAB friendly?

Thanks, Keith

+2


source to share


2 answers


You may have to go back to dynamic SQL here. Another idea is to pass an array of values, but I'm not sure about the interaction between Oracle and DAAB.



0


source


I recommend the above answer. And I want to amend ...
You can use Oracle with dab. but remember that your ref cursor must be named cur_out. If you don't need to perform DAAB tuning.



http://www.codeproject.com/KB/database/DAAB_On_ODPNet.aspx

0


source







All Articles