Oracle SQL 将 HEX 转换为字符

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6868517/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 11:31:13  来源:igfitidea点击:

Oracle SQL convert HEX to char

sqloraclehex

提问by Oh Chin Boon

i am trying to convert a hexadecimal to character in Oracle ideally something like thisfor Microsoft SQL Server

我试图十六进制转换为字符在甲骨文非常像这样为Microsoft SQL Server

select xx('0A') from dual;

where 0Ais hexadecimal for newline in Unix.

其中0AUnix 中的换行符是十六进制的。

回答by Bharathi

Try

尝试

SELECT UTL_I18N.RAW_TO_CHAR (<string>, <src_char_set>) FROM DUAL; 

For example,

例如,

SELECT UTL_I18N.RAW_TO_CHAR ('0A', 'AL32UTF8') FROM DUAL;

回答by Kevin Burton

or

或者

SELECT ASCIISTR(CHR(TO_NUMBER('0A','xx'))) FROM DUAL

回答by CloudyMarble

Try the HEXTORAWconverion function and check the referencefor more conversion funcitons

尝试HEXTORAW转换功能并查看参考以获取更多转换功能