我們試圖在CLOB字段中應用子字符串函數來修剪前4000個字符。我們正在收到以下錯誤消息。CLOB字段上的子串
下面是我們所使用的查詢:
select
cast(substr(field_name,1,4000) as varchar(4000))
from table_name;
錯誤報告:
SQL Error: ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 8000, maximum: 4000)
22835. 00000 - "Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: %s, maximum: %s)"
*Cause: An attempt was made to convert CLOB to CHAR or BLOB to RAW, where the LOB size was bigger than the buffer limit for CHAR and RAW types. Note that widths are reported in characters if character length semantics are in effect for the column, otherwise widths are reported in bytes.
*Action: Do one of the following 1. Make the LOB smaller before performing the conversion, for example, by using SUBSTR on CLOB 2. Use DBMS_LOB.SUBSTR to convert CLOB to CHAR or BLOB to RAW.
建議2看起來很有希望。 –