How can I create a firebird trigger from Lazarus? lazarus / 16-Databases ---------------------------------------------------------------------- jluix · 2007-04-18 21:34 Hi! I need to create a simple firebird trigger from lazarus. I'm using tibconnection, SQLQ (tsqlquery) and SQLT (tsqltransaction). I put this code:         SQLQ.SQL.Clear;         SQLQ.SQL.Add('SET TERM #;');         SQLQ.SQL.Add('CREATE TRIGGER BI_'+aNombre+' FOR '+aNombre+                      ' ACTIVE BEFORE INSERT POSITION 0 AS '+                      'BEGIN NEW.NumOp = GEN_ID(ID_'+aNombre+',1); END#');         SQLQ.SQL.Add('SET TERM ;#');         SQLQ.ExecSQL;         SQLT.Commit; but lazarus get an error saying that don't know TERM sentence in line 1 and doesn't create the trigger. As you can see I need to create the trigger dinamically because I'm creating several tables that need an Automatic counter (that is the meaning of this trigger). Of course, the sequence has been created before. Could you help me? ---------------------------------------------------------------------- Saverio · 2007-04-24 06:51 Hello Try a code like this: CREATE TRIGGER mytrigger FOR mytable                     ACTIVE BEFORE INSERT POSITION 0 AS BEGIN   UPDATE mytable SET mycolumn = 10; END