Problem
Can't append text to a blob field, when this value is NULL, using simple concat (||).
Docs base: https://firebirdsql.org/refdocs/langrefupd21-blob.html
Test Env
Assuming types:
- fieldTarget ~ BLOB
- tablePk ~ VARCHAR(5)
Like this:
UPDATE tablename
SET fieldTarget = fieldTarget || :string
WHERE tablePk = :pkTarget;
After execute, no one error returns but the field still null

All string operations (like ||-concatenation) are bound by maximum
VarCharsize limit (which is 32 KBytes, which is less than 8200 letters in UTF-8 encoded text).However there seems to be
BLOB-oriented functions. It also does not need escapingNULL-values withCOALESCE.See
LIST().Hence, using derived tables:
The typecasting is to assign data-type to the parameter-only expression.
P.S. the documentation also claims that
P.P.S. Ready to run example, tested on FB 2.1.7
Passing names like
RDB$TRIGGER_1would give you a system trigger that has no source text, thus has aNULLvalue in the field. Easy to check that you need noCOALESCE-screening here.