Subject Re: [firebird-support] BLOB update in trigger
Author Helen Borrie
At 11:57 PM 19/11/2003 +0200, you wrote:
>I need to update a table - a BLOB field (appendig some lines of text) every
>time a trigger fires. How can I do that ?

The short answer is: you can't. It isn't possible to update a blob, or
append a string or another blob to a blob. "Updating" a blob involves
completely replacing an existing blob with a new one.

The long answer is that you may be able to find (or write) a UDF that can
take a blob, convert it to a string and then pass a new blob back to a SP
or trigger. But I don't know how/whether a trigger has the ability to
create a new blob_id. AFAIU, it is the client that requests a new blob_id,
so, by trigger-time, it is too late.

Firebird does allow you to pass a string to a text blob, provided total
string doesn't exceed the maximum length of a varchar (32Kb - 2
BYTES). This won't help much in a trigger, though, since you can't pass
arguments to a trigger.

heLen