views:

146

answers:

2

Hello,

I am using 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

A: 

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.

IronGoofy
A: 

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

Rajdip