Subject RE: [firebird-support] attempted update of read only field
Author Sasha Matijasic
>
> When attempting to create a trigger on a table in Firebird 2.0.3 using
> ISQL I get the following error:
>
> Statement failed, SQLCODE = -151
> attempted update of read-only column
> After line 1 in file c:\swbtemp\test.sql
>
> The DDL to create the trigger is as follows:
>
> SET TERM ^ ;
>
> CREATE TRIGGER LDS_AFTER_UPDATE FOR LD_STOP
> AFTER UPDATE POSITION 0
> AS
> BEGIN
> /* If any of the EDI sensitive dates have changed, then clear the
> '214'
> date to force the EDI status update to be sent again. */
> IF (OLD.LDS_APPT_DATE_LOW IS NULL AND NEW.LDS_APPT_DATE_LOW IS NOT
> NULL) THEN
> BEGIN
> NEW.LDS_APPT_214_DATE = NULL;
> END
[...]

new context variables in AFTER update trigger is read only. You can find it on page 53 in release notes.

Sasha