plsql中&符号的处理

发布时间 2023-06-16 16:27:32作者: moonsoft

SQL语句中的字符串中出现了&符号,当执行的时候会被认为是参数需要传递,PLSQL会弹出一个variables的窗口

 

解决的方法是:

     在正常的编写下将&替换为 '||'&'||'

 

   update table set col='a&b' where col=1

 

 修改为

   update table set col='a'||'&'||'b' where col=1

 

另一篇:

PLSQL在执行含有&语句的时候会弹窗 &后边的被认为含有参数需要传递:
如:insert into student(no,name,sex,other) value ('001','张三','男','abc&ddd');
解决办法:
insert into student(no,name,sex,other) value ('001','张三','男','abc'||'&'||'ddd');
或者
insert into student(no,name,sex,other) value ('001','张三','男','abc'||chr(38)||'ddd');
参考链接:https://blog.csdn.net/ablipan/article/details/8650974
————————————————
版权声明:本文为CSDN博主「qq_34812227」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_34812227/article/details/103893741