Subject Re: [firebird-support] FB2 and Triggers.
Author Dmitry Yemanov
Michael Vilhelmsen wrote:
>
> As I can read in the release notes somewhere I cannot create a trigger
> like this in FB2.
>
> CREATE TRIGGER EKSP_DEL_RETTIG FOR EKSPEDIENTER ACTIVE AFTER DELETE
> POSITION 0 AS
> begin
> Delete from Eksp_Maa Where EkspID=EKSPEDIENTER.NR;
> end
>
> This was posible in FB 1.5.3.

It was a problem in FB 1.5. All references to the base table should use
either OLD or NEW contexts.

> My question is:
>
> I have running databases on FB1.5 that have a trigger like this.
> I can make a backup in FB1.5 and then do a restore in FB2 with the
> above trigger it works. The DB gets restored. And the trigger gets
> fired and does its work (eventhough the syntax is wrong)

The restore doesn't check syntax. The compiled BLR for the trigger is
correct and hence executed without problems.

> So a trigger created in FB15, backed up, restored in FB2 with a wrong
> syntax will work ?

Yes.


Dmitry