Data Access Application Block (DAAB) and the SQL IN keyword (multiple criteria)
I am using开发者_Python百科 the Patterns and Practices Data Access Application Block and I want to be able to perform a SELECT using multiple criteria like you can do in SQL using the IN keyword. Such as:
SELECT * FROM SomeTable WHERE PrimaryKey IN (@keys)
How can I pass in the @keys values? I do not want to have to dynamically build my SQL.
I’m querying against an Oracle database.
Additionally, is there another way to do such a query that is more DAAB friendly?
Thanks, Keith
You may have to revert to dynamic SQL here .. one other idea is to pass in an array of values, but I'm not sure about the interaction betweeen Oracle and DAAB.
I recommend the above answer.
And want to amend...
You can use Oracle with dab.
but keep it in mind your ref cursor should be named as cur_out.
Unless you need to do customization over DAAB.
http://www.codeproject.com/KB/database/DAAB_On_ODPNet.aspx
精彩评论