oracle - oracle sqlplus select query with apostrophe converts to?
问题描述
sqlplus -s ${uidpwd} > ${TEMP_FILE} 2>${LOG_FILE} << EOF
SET LINESIZE 32767
SET PAGESIZE 0
set long 2000000000
set longchunksize 10000000
SET TRIMSPOOL ON
SET RECSEP OFF
SET HEADSEP OFF
SET HEADING OFF
SET FEEDBACK OFF
SET SERVEROUTPUT ON
SET ECHO OFF
SET VERIFY OFF
whenever oserror exit 9
whenever sqlerror exit sql.sqlcode
Select description from table;
exit;
EOF
This is returning me with ? for all names having "apostrophe'
Actual:
- it's
- that's
Result:
- it?s
- that?s
After generating file (spool result) I tried this way "sed "s/?/'/g" ${TEMP_FILE}" -- this is not working and also this could replace "?" in the column values like "what is your name?" to "what is your name' ".
解决方案
推荐阅读
- python - 用python计算向量中的每个4元素乘积
- python-3.x - 正则表达式 | 提取前面定义的字符串的数字
- migration - 如何将 jira 的 sprint 迁移到 Azure DevOps?
- c# - 使用 httpclient 将 curl 命令转换为 C# 代码
- mongodb - 连接到 AWS 上的 DocumentDB/MongoDB 实例时出现问题
- javascript - 如何获取时刻时区当前配置的时区?
- python - 子类化一个python类来改变初始化器是最好的模式吗?
- javascript - 如何使用 sequelize 和节点插入由多个对象组成的数组?
- ios - Objective-C 数据类型问题
- postgresql - 完全重新安装后 psql 无法连接到服务器 [Ubuntu 21.10 / PostgreSQL 13]