user1121440
user1121440

Reputation: 1

Multiple triggers don't work on firebird

create trigger tr_buFile_fileid for BUFiles before insert as 
begin
IF (NEW.FileID IS NULL) THEN NEW.FileID = GEN_ID(FileID_generator, 1);
end
create trigger tr_buFile_insert for BUFiles after insert as 
begin 
update miscitems set TotalSize = TotalSize + new.BuFileSize;
end

create trigger tr_buFile_update for BUFiles after update as 
begin 
if (new.DeletionTime < '9223372036854775807' and new.DeletionTime != old.DeletionTime) then
update miscitems set TotalSize = TotalSize - old.BuFileSize;
end

I created three triggers on a firebird database. My application use odbc connection to operate on the database. The problem is that the second trigger (tr_buFile_insert) doesn't work if make an insertion on the BuFiles table. However this trigger works if I test them in SQL Manager for InterBase/Firebird.

Any help is appreciated.

Thanks, Shiping

Upvotes: 0

Views: 403

Answers (1)

Biju Soman
Biju Soman

Reputation: 438

Your triggers seems ok . I am afraid you are connecting to another db from application . Please check it . Please also check the trigger status is "ACTIVE"

Upvotes: 1

Related Questions