May be this is a bug in oracle? Here is what I found out.
1. create a table with blob field and insert a empty blob record.
SQL>create table demo(id number, data blob);
SQL>insert into demo values(1,empty_blob());
2. Insert a file of size 1 MB into the blob field using JDBC API.
After inserting the file, try reading and verifying the contents.
3. Now insert another file of size 500kb ( file size should be less
than previouly inserted file) into the same record( id=1) blob field.
When you read this blob, you'll see that blob size is returning a
size of 1MB. And the worst thing is, the blob stream in addition to
the new file, has old files junk characters in the end.
So once a empty blob is used to store some data, it should not be
modified and used to store another set of data. To resolve this issue,
I delete the record and insert a new record in order to update the
blob field with the new data.
-saM
Hi there!
I have the same Problem here but at another context.
-----------
Did you find out if this problem can be solved somehow?
My situation is a little bit more complicated.
I have a table with a blob field.
In the blob field is a record of X kb.
Now I need to get rid of the X kb.
If I use null as value, then I loose the reference.
If I use empty blob, I dont gain free space, which is my goal.
How can I get rid of the blob data, without loosing the structure?
I am talking about 160 Gbyte blob Data, which must be dropped somehow?
and also quick,
so please answer as soon as possible,
Many many thanks,
kostas
D Rolfe - 22 Jul 2004 17:38 GMT
> Hi there!
> I have the same Problem here but at another context.
[quoted text clipped - 9 lines]
>
> How can I get rid of the blob data, without loosing the structure?
Have you tried the truncate method of oracle.sql.BLOB?
David Rolfe
Orinda Software
Dublin, Ireland
Roedy Green - 22 Jul 2004 18:02 GMT
>I am talking about 160 Gbyte blob Data, which must be dropped somehow
>and also quick,
>so please answer as soon as possible,
something that big probably should be stored in its own file.

Signature
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.