db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajesh Kartha <kar...@Source-Zone.Org>
Subject Re: Triggers and BLOB's
Date Thu, 08 Dec 2005 16:31:49 GMT
Tony Seebregts wrote:

>Hi,
>
>I'm trying to copy a BLOB column to another table from the trigger row
>in an AFTER INSERT trigger and am getting the following error:
>
>SQL Exception: An attempt was made to put a data value of type
>'org.apache.derby.impl.jdbc.EmbedBlob' into a data value of type 'BLOB'.
>
>The trigger statement looks like:
>
>CREATE TRIGGER tableTrigger
>       AFTER INSERT ON testTable
>       REFERENCING NEW AS TriggerRow
>       FOR EACH ROW
>       MODE DB2SQL
>       INSERT INTO anotherTable (name,info)
>                     VALUES (TriggerRow.name.TriggerRow.info)
>
>Any idea what is wrong or if there is any way to make this work ?
>
>regards
>
>Tony Seebregts  
>
>  
>
There is an existing issue logged in JIRA for a similar case.

http://issues.apache.org/jira/browse/DERBY-438

Comments from the issue:
<snip>
1) If blob data is < 32K...

If the actual data in the table is less than 32K in length, the result 
will be:

ERROR XCL12: An attempt was made to put a data value of type 
'org.apache.derby.impl.jdbc.EmbedBlob' into a data value of type 'BLOB'.

2) If blob data is > 32K...

If at least one row in the table has blob data that is longer than 32K 
(which means that Derby will stream it, so far as I can tell), then the 
error will be:

ERROR XCL30: An IOException was thrown when reading a 'BLOB' from an 
InputStream.
ERROR XJ001: Java exception: ': java.io.EOFException'.
</snip>

-Regards,
Rajesh


Mime
View raw message