
sql语句执行指定存储过程在参数字符串中加like对引号的处理
当前有一存储过程执行的时候exec的第一个参数需要加like语句如execproc_page'info2whereidnotin(selecttop(0)idfromin...
当前有一存储过程 执行的时候 exec 的第一个参数需要加like语句 如
exec proc_page 'info2 where id not in( select top (0) id from info2 where centerclass=152 and bigcity=1 and centercity=7 order by id desc) and bigcity=1 and centercity=7 and centerclass=152 and smallsubclassinfo like ''%'||小型犬||'%'' ' ,'*',10,10,'id',1,'','id',0 请问对like旁的单引号大家都如何处理才能使存储过程正确执行? 展开
exec proc_page 'info2 where id not in( select top (0) id from info2 where centerclass=152 and bigcity=1 and centercity=7 order by id desc) and bigcity=1 and centercity=7 and centerclass=152 and smallsubclassinfo like ''%'||小型犬||'%'' ' ,'*',10,10,'id',1,'','id',0 请问对like旁的单引号大家都如何处理才能使存储过程正确执行? 展开
2个回答
2013-05-18
展开全部
双重单引号就行了~你这里的||小型犬||中的||是什么意思?like ''%'||小型犬||'%''改成like ''%||小型犬||%''
已赞过
已踩过<
评论
收起
你对这个回答的评价是?

2022-08-05 广告
苏州蓝晓生物科技有限公司。标准化核心产品:公司拥有完整的琼脂糖介质、葡聚糖介质、聚甲基丙烯酸酯介质生产线,年产分离介质50000L,产品质量稳定并达到国际领先水平。核心优势:公司核心技术人员拥有近二十年不同基质的基球开发和官能化的丰富技术经...
点击进入详情页
本回答由苏州蓝晓生物科技有限公司_提供
2013-05-18
展开全部
当前有一存储过程 执行的时候 exec 的第一个参数需要加like语句 如
exec proc_page 'info2 where id not in( select top (0) id from info2 where centerclass=152 and bigcity=1 and centercity=7 order by id desc) and bigcity=1 and centercity=7 and centerclass=152 and smallsubclassinfo like ''%'||小型犬||'%'' ' ,'*',10,10,'id',1,'','id',0 请问对like旁的单引号大家都如何处理才能使存储过程正确执行?
exec proc_page 'info2 where id not in( select top (0) id from info2 where centerclass=152 and bigcity=1 and centercity=7 order by id desc) and bigcity=1 and centercity=7 and centerclass=152 and smallsubclassinfo like ''%'||小型犬||'%'' ' ,'*',10,10,'id',1,'','id',0 请问对like旁的单引号大家都如何处理才能使存储过程正确执行?
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询