Oracle Error code: ORA-64203

问题

Oracle中将 clob 类型通过 to_char 转换为字符串类型时,如果clob内容过长,会转换失败,报ORA-64203的错误

解决方法

使用 DBMS_LOB.SUBSTR 代替 to_charclob 转成 varchar2, 第一个参数是字段名,第二个参数是截取多长,第三个参数是从什么位置开始截

注意:varchar2 是有长度限制的,最大值4000

DBMS_LOB.SUBSTR(lONG_CONTENT, 2000, 1)

官方说明

Database: 11g Release 2
Error code: ORA-64203
Description: Destination buffer too small to hold CLOB data after character set conversion.
Cause: An attempt was made to convert CLOB to CHAR, where the LOB size was bigger than the buffer limit for CHAR types or the CHAR buffer was not big enough to hold all data after character set conversion.
Action: Do one of the following: * Make the LOB smaller before performing the conversion. for example, by using SUBSTR on CLOB * Use DBMS_LOB.SUBSTR to convert CLOB to CHAR.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值