oracle中单引号的处理
2024-08-31 11:34:17
当想让输出的结果中字段带有单引号',
场景一:连续三个单引号'''
select '''helin''' from dual;
---'helin'
场景二:拼接字段的结果集--连续4个单引号
select 'update ct_cust_info set cust_name =',
'''' || a.cust_name || '''',
'cust_address = ',
'''' || a.cust_address || '''',
'where cust_id = ',
'''' || a.cust_id || ''''
from (select cust_id, cust_name, CUST_ADDRESS
from ct_cust_info_crm
minus
select cust_id, cust_name, CUST_ADDRESS from ct_cust_info_billing1) a
--1 update ct_cust_info set cust_name = '++SFVBIEJJTkc=' cust_address = '++TEVWRUwgMzUsIDI1IENBTkFEQSBTUVVBUkUsIENBTkFSWSBXSEFSRiwgTE9ORE9OLCBFMTQgNUxR' where cust_id = '100321000000002243'
--2 update ct_cust_info set cust_name = '++RE9ORyBIQU8=' cust_address = '++TEVWRUwgMzUsIDI1IENBTkFEQSBTUVVBUkUsIENBTkFSWSBXSEFSRiwgTE9ORE9OLCBFMTQgNUxR' where cust_id = '100321000000002258'
场景三:和场景2一致,另一种写法:q'/string/' 中间的string表示任何字符
select
'update ct_cust_info set cust_name =',
q'/'/'|| a.cust_name ||q'/',/',
'cust_address = ',
q'/'/'|| a.cust_address ||q'/'/',
'where cust_id = ',
q'/'/'|| a.cust_id ||q'/';/'
from
(select cust_id,cust_name,CUST_ADDRESS from ct_cust_info_crm
minus
select cust_id,cust_name,CUST_ADDRESS from ct_cust_info_billing1) a
最新文章
- jsPanel插件Option总结
- stunnel-client
- php网络编程
- css中box-shadow阴影效果的使用
- velocity模板使用建议
- RealThinClient (RTC)是什么?
- HDU 4720	Naive and Silly Muggles 2013年四川省赛题
- sql server 存储过程、事务,增删改
- ServiceStack.Hello——跨平台.net REST api服务搭建
- 三、WCF的宿主
- Beautiful Paintings
- 使用Aes对称加密解密Web.Config数据库连接串
- 分享:使用 TypeScript 编写的游戏代码
- JavaScript构造函数原理
- 【原创+整理】简述何为调用约定,函数导出名以及extern C
- IntelliJ IDEA 下的svn配置及使用的非常详细的图文总结
- Cf Round #403 B. The Meeting Place Cannot Be Changed(二分答案)
- ps aux命令解析
- Verilog的一些系统任务(一)
- IOS-OC 编码建议