INTERBASE / FIREBIRD information for specials



Special possibility, special feasibility:



1. RDB$DATABASE in trigger for read old & new values



create trigger MYTBL_UPD for MYTBL as

begin

  insert into MYTBL_ARCH select old.* from RDB$DATABASE;

end





2. useble RDB$DB_KEY in trigger



create trigger …..

as

  declare variable v_KEY char(8);

begin

  select old.RDB$DB_KEY from RDB$DATABASE

    INTO :v_KEY;

  ...

end







Special functions, error possibility:



1. alter table & make an archive table



create table MYTBL

(

  MyField1 integer,

  MyField2 integer

);



create table MYTBL_ARCH

(

  MyField1 integer,

  MyField2 integer

);



create trigger MYTBL_UPD for MYTBL as

begin

  insert into MYTBL_ARCH select old.* from RDB$DATABASE;

end



alter table MYTBL drop MyField2;

Error:

„there are 1 dependencies”

Cause:

The „old.* from RDB$DATABASE” is not dynamic in compiled BLR. It’s compiled actual field-list of MYTBL



alter table MYTBL add MyField3 integer;

alter table MYTBL_ARCH add MyField3 integer;

Warning:

Don’t show an error message, BUT the „old.* from RDB$DATABASE” is not dynamic.
The trigger don’t make an archive for new field!
You need drop and recreate triggers.



--- © eMeL Bt. & László Moravecz ---
copy freely if all text and this © info invariable