Subject | Re: Execute Block: Need Insert Into to trigger Primary Key generator. |
---|---|
Author | |
Post date | 2018-02-27T23:16:57Z |
Sorry for the first example. I knew it didn't work. I accidentally copied it from an attempt that didn't work. I really meant to copy the second example but didn't catch my error until after I posted.
Generator (copied from FlameRobin):
CREATE GENERATOR GEN_ACORD_DATA_ID;
Trigger (Copied from FlameRobin)
SET TERM ^ ;
CREATE TRIGGER TRG_ACORD_DATA_ID_BI FOR ACORD_DATA ACTIVE
BEFORE INSERT POSITION 0
AS
BEGIN /* Auto Increment trigger */
IF (NEW.FK_ID IS NULL) THEN
NEW.FK_ID = GEN_ID(GEN_ACORD_DATA_ID,1);
END^
SET TERM ; ^