Subject | Re: [firebird-support] Strange errors while creating a trigger |
---|---|
Author | Daniel |
Post date | 2005-02-25T11:58:31Z |
Hi Ivan
Thanks for your quick reply. Also thanks to Martijn. The maxLogID variable
issue is fixed - as you mentioned, the "select" statement was too much.
The trigger "TRU_country" is used to write information to a log table (named
here Shadow_country) when something changes in the country table.
I still can not write the trigger to the db. I get now the error message
"invalid request BLR at offset 103 undefined message number" - any idea?
What do you mean by "specifying zero step"?
Regards
Daniel Putra
Thanks for your quick reply. Also thanks to Martijn. The maxLogID variable
issue is fixed - as you mentioned, the "select" statement was too much.
The trigger "TRU_country" is used to write information to a log table (named
here Shadow_country) when something changes in the country table.
I still can not write the trigger to the db. I get now the error message
"invalid request BLR at offset 103 undefined message number" - any idea?
What do you mean by "specifying zero step"?
Regards
Daniel Putra
----- Original Message -----
From: "Ivan Prenosil" <Ivan.Prenosil@...>
To: <firebird-support@yahoogroups.com>
Sent: Friday, February 25, 2005 1:29 PM
Subject: Re: [firebird-support] Strange errors while creating a trigger
|
| > I want to insert the following trigger into a Firebird 1.5.2 database
but
| > there are errors.
| > Unfortunately the error messages are not clear enough to me (invalid
request
| > BLR at offset 89).
|
| Probably non-existing generator. Is it really named
| "LogTable_GEN"
| and not just
| LogTable_GEN
| ?
|
|
| > Secondly why would this "maxLogID = (select gen_id("LogTable_GEN", 0)
from
| > RDB$DATABASE);" not work?
|
| Why do you use rdb$database if you do not select any data from it ? This
should be enough:
| maxLogID = gen_id(LogTable_GEN, 0);
|
| Also, specifying zero step is very suspicious, what are you wanting to
achieve ?
|
| Ivan
|
| >
| >
| > 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);
| > insert into Shadow_country ( common_id, operationType, status, CID,
CNAME,
| > 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 ;^
|
|
|
|
|
| Yahoo! Groups Links
|
|
|
|
|
|