Subject Database trigger - On start transaction
Author Michael Vilhelmsen
Hi
Im running FB on 2.1.0.17798 on Windows.

I have a DB.
In this DB I created this table:

CREATE TABLE A
(
ID INTEGER NOT NULL,
BRUGER VARCHAR( 30) COLLATE NONE,
HVAD INTEGER,
CONSTRAINT PK_A PRIMARY KEY (ID)
);


SET TERM ^^ ;
CREATE TRIGGER A_ID FOR A ACTIVE BEFORE INSERT POSITION 0 AS
begin
if ( (new.ID is null) or (new.ID = 0) )
then new.ID = gen_id(A_GEN, 1);
end
^^
SET TERM ; ^^



I then created this database trigger:

SET TERM ^^ ;
RECREATE TRIGGER BRUGER_STARTTRANSACTION
INACTIVE ON TRANSACTION START POSITION 10
AS
begin
insert into a (bruger, Hvad) values (current_user,2);
end ^^


Its created as INACTIVE.




Here after I get this error when trying to connect to the DB using
IBObjects:

ISC ERROR CODE:335544361

ISC ERROR MESSAGE:
attempted update during read-only transaction
At trigger 'BRUGER_STARTTRANSACTION' line: 5, col: 3

I can still connect using i.e. IBX.

Then connecting using IBX I delete the database trigger and I can once
again connect via OBObjects

But should I get this error sinse the database trigger is INACTIVE?

Michael