oracle 如何在Oracle的SQL SELECT语句中用ascii替换字符
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4591784/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to replace a character by its ascii in SQL SELECT statement in Oracle
提问by Bilal Abdulaal
The database we are using which we only have reading access has a character that is shown as a square, it has the ascii code of 26 or x1A in hex and i want to replace it in the SELECT statement to another character using its ascii only.
我们使用的只有读取权限的数据库有一个显示为正方形的字符,它的 ascii 代码为 26 或 x1A 十六进制,我想在 SELECT 语句中将它替换为另一个仅使用其 ascii 的字符。
We are using Oracle 10g.
我们正在使用 Oracle 10g。
Is there a way? Maybe using Regular Expressions?
有办法吗?也许使用正则表达式?
Thank you,,,
谢谢,,,
回答by rkg
You can use use the REPLACE
function:
您可以使用使用REPLACE
功能:
SELECT REPLACE(text,CHR(26),otherChar) FROM .........