Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error- ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion

I am attempting to read a BLOB message and display it as a variable in one of my procedures, but am getting the error below:

Error - ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 9923, maximum: 2000)

I have googled and found a suggestion to trim the BLOB message as below, but I would rather display the complete BLOB message as a string.

UTL_RAW.CAST_TO_VARCHAR2(dbms_lob.substr(variable_name,2000,1)) 

How can I display the complete message? Is there a setting on either the database or procedure level that I can change?

like image 321
kumarb Avatar asked Aug 27 '14 04:08

kumarb


2 Answers

I got this worked by using the option described in

http://www.dba-oracle.com/t_convert_blob_varchar_datatype.htm

like image 195
kumarb Avatar answered Oct 14 '22 13:10

kumarb


Try to use DBMS_LOB.GETLENGTH(), instead of trimming the string

like image 43
Артур Курицын Avatar answered Oct 14 '22 14:10

Артур Курицын