开发者

Data Access Application Block (DAAB) and the SQL IN keyword (multiple criteria)

开发者 https://www.devze.com 2022-12-09 07:45 出处:网络
I am using开发者_Python百科 the Patterns and Practices Data Access Application Blockand I want to be able to perform a SELECT using multiple criteria like you can do in SQL using the IN keyword. Such

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

0

精彩评论

暂无评论...
验证码 换一张
取 消