Updating CLOBS - size does not shrink?

From: Joop Kaashoek <jkaashoek_at_teckchek.com>
Date: Wed, 02 May 2001 23:03:07 -0700
Message-ID: <3AF0F49A.5EE462B_at_teckchek.com>


[Quoted] If you try to update a CLOB with less data than its current size, the CLOB size
does not appear to shrink. So if the original size of the CLOB is 100 bytes and
you update it with a string of 80 bytes, the size stays at 100 and the data in the
last 20 positions is old.

I tried using two methods to update the clob, and both gave the same result:

[Quoted] oracle.sql.CLOB the_clob = ...;

the_clob.putString(1, str);  

or

DataOutputStream out = new DataOutputStream(the_clob.getAsciiOutputStream());

[Quoted] out.writeBytes(str);
out.flush();
out.close();


This unexpected feature is not listed or warned about in any documentation that I came across sofar. Is there a work-around for this? Any help is appreciated.

[Quoted] I am using Oracle 8.1.5 and thin drivers (classes12.zip) on WebLogic 4.51

Thanks,

Joop Kaashoek Received on Thu May 03 2001 - 08:03:07 CEST

Original text of this message