I would like to update or insert a row in a Firebird 2.5 table, but I want the values ββthat I insert to be ignored if they are null.
I was hoping it would be like this:
update or insert into TargetTable ( FieldA, FieldB ) values ( :fielda, coalesce(:fieldb, FieldB ))
However, Firebird does not allow referencing FieldB in the "values" list.
This enables the update syntax:
update TargetTable set FieldB = coalesce( :fieldb, FieldB ) where FieldA = :fielda
But this requires that I handle the inserts separately.
Is there a way to get both an update / insert and a union into a field value?
Davek source share