sql - Oracle SQL - 查找和替换 ASCII
问题描述
在我的数据库中,使用这些 ASCII 值插入了特殊字符
ASCII(' ') ASCII('')
49828 32
列描述中显示的ASCII 值49828显示为特殊字符¤
如何找到所有具有此特殊字符的值?以及如何用常规空格替换它(ASCII 32)
解决方案
我会说你会使用REPLACE
(如你所说)。
样品表:
SQL> create table test (col) as
2 select 'x' || chr(67) || 'y' from dual union all
3 select 'x' || chr(49828) || 'y' from dual;
Table created.
内容(忽略我的SQL*Plus 和我的数据库Ą
中显示的内容):
SQL> select * from test;
COL
----
xCy
xĄy
仅更新包含该值的行:
SQL> update test set
2 col = replace(col, chr(49828), chr(32))
3 where instr(col, chr(49828)) > 0;
1 row updated.
结果:
SQL> select * from test;
COL
----
xCy
x y
SQL>
推荐阅读
- emv - ASC 122U NFC 读卡器与 EMV 非接触式卡兼容
- snowflake-cloud-data-platform - Azure ADF V2:将数组类型的管道参数传递给触发雪花过程的 Azure 函数
- javascript - Alpine.js 获取数据 api 并从 select 中绑定值
- visual-studio - 通过命令行使用 Visual Studio 部署到 VM 中的远程调试器
- html - 在 pug 模板引擎语言中传递变量的问题
- sql - Sql使用循环插入表
- python - 在 python pyspark 中捕获结构变量的标头路径
- kotlin - 如何将 registerForActivityResult 与 StartIntentSenderForResult 合同一起使用?
- javascript - 调用具有非字母字符的 JSON 键
- javascript - 在R中单击传单地图按钮时显示和隐藏数据表