Subject | Incompatible trigger type (Database Trigger) |
---|---|
Author | Nikolay Marinov |
Post date | 2009-01-13T12:58:19Z |
Hi group,
very strange, the following trigger compiles fine in one database, but
gives this error at another. The both databases has ODS 11.1, are on
the same server and are free of errors (checked gfix -v -f).
Server is FB 2.1 (WI-V6.3.1.17910)
Actually the trigger is already created, altering raises the error.
SET TERM ^ ;
CREATE OR ALTER TRIGGER "LOG_tDBOnConnect"
ACTIVE ON CONNECT POSITION 0
as
declare variable sessid integer;
declare variable doLog char(1);
declare variable rip varchar(40);
begin
if (user starting WITH 'REPL') then exit;
select first 1 t."DoLog" from "tSettings" t into :dolog;
if (doLog<>'Y') then exit;
select rdb$get_context('USER_SESSION', 'SESSID') from rdb$database
into :sessid;
if ((sessid is not null ) and (sessid>0)) then exit;
sessid=gen_id(gen_db_id,1);
select rdb$set_context('USER_SESSION', 'SESSID',:sessid) from
rdb$database into :rip;
SELECT rdb$get_context('SYSTEM', 'CLIENT_ADDRESS') from
rdb$database into :rip;
insert into "tDB" ("Id",
"User",
"RemoteIP",
"StampIn")
values (:sessid,
current_user,
:rip,
current_timestamp);
SELECT rdb$set_context('USER_SESSION', 'RESDETIDSYSTEM','N') from
rdb$database into :rip;
end
^
SET TERM ; ^
================
Dynamic SQL Error.
Invalid command.
Incompatible trigger type.
very strange, the following trigger compiles fine in one database, but
gives this error at another. The both databases has ODS 11.1, are on
the same server and are free of errors (checked gfix -v -f).
Server is FB 2.1 (WI-V6.3.1.17910)
Actually the trigger is already created, altering raises the error.
SET TERM ^ ;
CREATE OR ALTER TRIGGER "LOG_tDBOnConnect"
ACTIVE ON CONNECT POSITION 0
as
declare variable sessid integer;
declare variable doLog char(1);
declare variable rip varchar(40);
begin
if (user starting WITH 'REPL') then exit;
select first 1 t."DoLog" from "tSettings" t into :dolog;
if (doLog<>'Y') then exit;
select rdb$get_context('USER_SESSION', 'SESSID') from rdb$database
into :sessid;
if ((sessid is not null ) and (sessid>0)) then exit;
sessid=gen_id(gen_db_id,1);
select rdb$set_context('USER_SESSION', 'SESSID',:sessid) from
rdb$database into :rip;
SELECT rdb$get_context('SYSTEM', 'CLIENT_ADDRESS') from
rdb$database into :rip;
insert into "tDB" ("Id",
"User",
"RemoteIP",
"StampIn")
values (:sessid,
current_user,
:rip,
current_timestamp);
SELECT rdb$set_context('USER_SESSION', 'RESDETIDSYSTEM','N') from
rdb$database into :rip;
end
^
SET TERM ; ^
================
Dynamic SQL Error.
Invalid command.
Incompatible trigger type.