Dapper WHERE IN statement with ODBC

心已入冬 提交于 2019-12-02 07:11:32

问题


I am using Dapper on ODBC provider, which as known does not support named parameters. For most of my queries I used pseudo named parameters: ?name?. However, when I try to

 string query = $"select * from \"{TableName}\" where ID in ?Ids?";
 return connection.Query<CdfGroupByCdfUserRecord>(query, new {Ids = ids}).ToArray();

I see that Dapper generates query

select * from "MY_TABLE" where ID in (?Ids1,?Ids2,?Ids3,?Ids4,?Ids5)?

What should I do to get it work?


回答1:


This appears to be a bug in dapper. I'll try to fix it for 1.50.2. I've logged it (for tracking purposes) here



来源:https://stackoverflow.com/questions/38527197/dapper-where-in-statement-with-odbc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!