Subject | Re: Triggers |
---|---|
Author | Adam |
Post date | 2007-04-18T02:08:33Z |
--- In firebird-support@yahoogroups.com, "visakan13" <visakan13@...>
wrote:
2. It looks like FlameRobin is using ; as a SQL command terminator.
Because the trigger is internally needing one, FlameRobin only sees
down to the first ; so it does not see a valid create trigger statement.
Try using
SET TERM ^ ;
CREATE TRIGGER Tri_Area FOR AREA
ACTIVE BEFORE INSERT
AS
BEGIN
new.SEQ = GEN_ID(AREA_NEXTNO,1);
END
^
SET TERM ; ^
Adam
wrote:
>1. You may need the word ACTIVE between AREA and BEFORE. (not 100% sure)
> Hi All,
>
> I have just created a Trigger:
>
> CREATE TRIGGER Tri_Area FOR AREA
> BEFORE INSERT
> AS
> BEGIN
> new.SEQ = GEN_ID(AREA_NEXTNO,1);
> END;
>
> When I try to create this trigger through Flame Robin I get the Error:
>
> Preparing query: CREATE TRIGGER Tri_Area FOR AREA
> BEFORE INSERT
> AS
> BEGIN
> new.SEQ = GEN_ID(AREA_NEXTNO,1)
>
2. It looks like FlameRobin is using ; as a SQL command terminator.
Because the trigger is internally needing one, FlameRobin only sees
down to the first ; so it does not see a valid create trigger statement.
Try using
SET TERM ^ ;
CREATE TRIGGER Tri_Area FOR AREA
ACTIVE BEFORE INSERT
AS
BEGIN
new.SEQ = GEN_ID(AREA_NEXTNO,1);
END
^
SET TERM ; ^
Adam