[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ora-22835 buffer too small for clob to char or blob to raw conversion

Posted on 2009-04-24
4
Medium Priority
?
8,970 Views
Last Modified: 2013-12-18
I am querying a view in Oracle 10g and received this error below:
ora-22835 buffer too small for clob to char or blob to raw conversion

The problematic field datatype is blob and I need to convert it to text to UNION several tables. I tried using DBMS_LOB.SUBSTR but still getting the same error. Any idea?
0
Comment
Question by:burgomaster
  • 2
3 Comments
 
LVL 40

Expert Comment

by:mrjoltcola
ID: 24229410
What size are you passing to DBMS_LOB.SUBSTR? Try something really small to verify.
0
 
LVL 4

Accepted Solution

by:
marper earned 2000 total points
ID: 24244147
Cause
This is expected behavior becuase it is an unpublished Bug
in 10.1 (and 9i) due to which the conversion was truncated without warning or error.

However, in 10.2 this bug was fixed and so the truncation does not occur but also the varchar can
only hold 4000 bytes. In this case the clob is 5608 bytes and so the TO_CHAR cannot be performed and the error is expected.

Solution
Use DBMS_LOB.SUBSTR instead of TO_CHAR.
The DBMS_LOB.SUBSTR function returns a VARCHAR just like TO_CHAR, and you can limit the amount of data that you want to convert.

0
 
LVL 4

Expert Comment

by:marper
ID: 24244216
I just double checked...
This issue is fixed in 10.2.0.3 (Server Patch Set) and
11.1.0.6 (Base Release)
 
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses
Course of the Month20 days, 3 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question