ORA-01465: invalid hex number(无效的十六进制数字)

  • Post author:
  • Post category:其他


问题背景:

使用SQL语句在SQLDeveloper中更新Blob字段,弹出该提示

ORA-01465: invalid hex number

解决办法:

参考StackOverflow:https://stackoverflow.com/a/21438975/1280694

当需要将VARCHAR2 类型数据插入到BLOB时,可以使用

utl_raw.cast_to_raw



函数,该函数可以将你输入的VARCHAR2数据转换为RAW数据类型而且不会更改你输入的数据内容,然后再插入到BLOB列中。

To insert a

VARCHAR2

into a

BLOB

column you can rely on the function

utl_raw.cast_to_raw

as next:

insert into mytable(id, myblob) values (1, utl_raw.cast_to_raw('some magic here'));

It will cast your input

VARCHAR2

into

RAW

datatype without modifying its content, then it will insert the result into your

BLOB

column.

More details about the function


utl_raw.cast_to_raw



版权声明:本文为xinglu31原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。