Subject | Re: [firebird-support] create trigger using isql |
---|---|
Author | John Jaabæk |
Post date | 2005-04-29T17:59:26Z |
Take a look here. It might help.
CREATE TRIGGER "TR_ADD_ID_tbl_Kategori" FOR "tbl_Kategori" ACTIVE
BEFORE INSERT POSITION 0
AS
BEGIN
if (NEW.ID IS NULL) then
NEW.ID = gen_id("tbl_Kategori_ID_GEN",1);
END
CREATE TRIGGER "TR_ADD_ID_tbl_Kategori" FOR "tbl_Kategori" ACTIVE
BEFORE INSERT POSITION 0
AS
BEGIN
if (NEW.ID IS NULL) then
NEW.ID = gen_id("tbl_Kategori_ID_GEN",1);
END
On Thursday 28 April 2005 21:02, Paul Surette wrote:
> I have been trying to create a trigger without any luck and was hoping
> someone might have some idea what i am doing wrong.
>
> my table has the field tripid integer not null primary key.
> my generator is autonumber.
> when I try:
> set term !!;
> create trigger i_tripid for trip
> active before insert
> as
> begin
> if(new.tripid is null)
> then
> new.tripid = gen_id(autonumber,1);
> end
> set term ;!!
>
> I get the error response:
> SQL error code = -104
> Token unknown - line 9, char 1
> set
>
> my trigger is not created and my line terminator is in fact !! not ;.
>
> Thanks in advance
>
> ---
> Paul
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
--
John H. Jaabæk
tlf. +47 915 24 599
Uavhengig Velværekonsulent for Nikken
http://www.nikken.com
http://www.nikkenuk.com
http://www.5pillars.com