'||'的使用问题

ZHANGGANGG 2003-03-08 08:55:27
一句select语句:
sqlstr:='select * from my_table where field in ('A','B') and ...';
编译时出错。
然后我用:
str1:='A''
str2:='B';
/
sqlstr:='select * from my_table where field in ('A','B') and ...';
/
出来的结果是...field in (A,B) ...;
少了冒号!!
如何解决这个问题?是否使用||,如何使用?谢谢!
...全文
39 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
snowy_howe 2003-03-08
  • 打赏
  • 举报
回复
sqlstr:='select * from my_table where field in (''A'',''B'') and ...';
是两个单引号,不是双引号,注意了。
developer2002 2003-03-08
  • 打赏
  • 举报
回复
符号' 要用符号' 转义
maohaisheng 2003-03-08
  • 打赏
  • 举报
回复
改成双引号试验一些,注意在oracle里面SQL语句中的字符串必须是单引号
sqlstr:="select * from my_table where field in ('A','B') and ...";

17,082

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧