Subject | Re: [firebird-support] Strange errors while creating a trigger |
---|---|
Author | Martijn Tonies |
Post date | 2005-02-25T11:25:47Z |
Daniel,
will also work just fine. :-)
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server
Upscene Productions
http://www.upscene.com
> I want to insert the following trigger into a Firebird 1.5.2 database butrequest
> there are errors.
> Unfortunately the error messages are not clear enough to me (invalid
> BLR at offset 89).maxlogid = gen_id("LogTable_GEN", 0);
> Secondly why would this "maxLogID = (select gen_id("LogTable_GEN", 0) from
> RDB$DATABASE);" not work?
>
>
> SET TERM ^ ;
> create trigger TRU_country FOR country ACTIVE AFTER UPDATE AS
> declare variable maxLogID NUMERIC(18,0);
> begin
> insert into LogTable ( table_name ) values ( 'country');
> maxLogID = (select gen_id("LogTable_GEN", 0) from RDB$DATABASE);
will also work just fine. :-)
> insert into Shadow_country ( common_id, operationType, status, CID, CNAME,With regards,
> old_CID, server_name ) values (:maxLogID, 'U', 'B', old.CID, old.CNAME,
> old.CID, 'server2_3001');
> insert into Shadow_country ( common_id, operationType, status, CID, CNAME,
> old_CID, server_name ) values (:maxLogID, 'U', 'A', new.CID, new.CNAME,
> old.CID, 'server2_3001');
> end ^
> SET TERM ;^
>
>
> It would be great if anybody could help me.
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server
Upscene Productions
http://www.upscene.com