DapperLib / Dapper

Dapper - a simple object mapper for .Net
https://www.learndapper.com/
Other
17.54k stars 3.68k forks source link

WHERE IN issue for ODBC in 1.50.2 #619

Open ivan-sj opened 8 years ago

ivan-sj commented 8 years ago

I've query like this:

Connection.Query<Table1>("SELECT Col1, Col2 FROM Table1 WHERE Col1 = ?col1? AND Col2 IN ?col2?",  new {col1 = 1, col2 = new[] {2, 3}})

As result I have SQL:

SELECT Col1, Col2 FROM Table1 WHERE Col1 = ? AND Col2 IN (?,?)

But I have only one parameter in DB command col1=1, instead of three,

When I run query with parameter that has only list, i.e.

Connection.Query<Table1>("SELECT Col1, Col2 FROM Table1 WHERE Col2 IN ?col2?",  new {col2 = new[] {2, 3}})

Everything is correct, I've two parameters in DB command.

grahamehorner commented 8 years ago

complex where conditions that have composite logic like IN AND OR don't work maybe the implementation should determine if the object supplied has a property derived from a given type of interface like IComplexCondition that has a mapping to a Condition type:- LIKE IN NOT AND OR?

znyet commented 5 years ago
other database the params is   @name
oralce   :name