我想在存储过程里面查一个语句
传进的参数是不带单引号的。怎么加啊select * from table where REPORT_MONTHLY in ('2008-05','2008-04','2008-06')
但是在传进去参数的时候是不带单引号的。
在存储过程里面怎么加上单引号啊
传进的参数是不带单引号的。怎么加啊select * from table where REPORT_MONTHLY in ('2008-05','2008-04','2008-06')
但是在传进去参数的时候是不带单引号的。
在存储过程里面怎么加上单引号啊
你是不是说传进去的是2008-05,然后在存储过程里变成'2008-05',再放到sql中?
我很想说“不能”,又想问“何必要这样做呢?哪个架构师让你设计这样的解决方案?”。
还是看看楼下怎么说吧!
sqlstr:='select * from table where report_monthly in ('''||thedate||''')';也就是= select * from table where report_monthly in ('||thedate||');
select * from table where report_monthly in (' ¦ ¦thedate ¦ ¦','||secdate||','||thirddate||');
'2008-04'
'2008-05'
'2008-06'