参考了:http://topic.csdn.net/t/20060228/03/4582023.html以后如下写法还是不行
select * from table where a.productname like '%'+:productname+'%'直接写:like '%粉红经典%'可以查询经查sqlserver中用 '%'+@productname+'%'没有问题,oracle该如何使用like进行参数化的查询?
select * from table where a.productname like '%'+:productname+'%'直接写:like '%粉红经典%'可以查询经查sqlserver中用 '%'+@productname+'%'没有问题,oracle该如何使用like进行参数化的查询?
select * from table where a.productname like '%“ + productname + ”%'
但是还是没搞明白如何用like查。1楼的你给的是直接用字符串查,不是参数查询的方法。
如select * from tb where id = :id
like '%'|| :A ||'%'这种格式
然后在给参数的时候再加上'%%'
比方说参数是strA,则strA = "'%" + strA + "%'";
然后把处理过的strA给参数