在oracle字符串中使用了in,但是查不出数据

1 string getModel = "select * from TB_YBSH where ID in :ids";
2 OracleParameter p = new OracleParameter("ids", ids);
3 DataTable dt = DbHelperOra.ExecuteTable(getModel,p);

直接拼接就可以

 string getModel = "select * from TB_YBSH where ID in"+ids;

但是还是想要使用参数查询,在网上查了下,发现了instr的用法,于是写成这样,问题解决

string getModel = "select * from TB_YBSH where instr(:ids,ID)>0";
OracleParameter p = new OracleParameter("ids", ids);
DataTable dt = DbHelperOra.ExecuteTable(getModel,p);

参考http://overloving.iteye.com/blog/1638769

相关文章:

  • 2022-12-23
  • 2022-03-06
  • 2021-11-05
  • 2021-11-30
  • 2022-12-23
  • 2022-01-19
  • 2021-05-27
  • 2021-06-18
猜你喜欢
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2021-06-06
  • 2022-12-23
相关资源
相似解决方案