当前位置: 首页 > 工具软件 > Nina > 使用案例 >

java转移oraclr数据_Oracle转义 - JAVA_NINA的个人空间 - OSCHINA - 中文开源技术交流社区...

朱通
2023-12-01

Oracle的sql语句中,单引号'可以做转义字符。

如果需要拼接带单引号(')的字符串,则需要用两个单引号(''),其中一个单引号作为转义字符使用。

-------------------------------------------------------------------------------------------------------------------

例子:

select 'update t_ph_pf_check_item set item_goal_demand=' || '''' || item_goal_demand || '''' || ' where item_code= ' || ''''|| item_code ||''''||';'  from t_ph_pf_check_item i where i.item_goal_demand like '%$%';

sql结果:

update t_ph_pf_check_item set item_goal_demand='$year$年城乡居民健康档案规范化电子建档率≥$value$%。' where item_code= 'ehr';

 类似资料: