Subject Re: [ib-support] Using a Generator when creating a new record
Author Jill Thomson
At 12:42 28/02/02 +0000, Stevio wrote:

>SET TERM ^ ;
>CREATE TRIGGER SET_NEW_AUTHOR_ID FOR AUTHOR
>ACTIVE BEFORE INSERT POSITION 0
>AS
>BEGIN
> IF (NEW.AUTHOR_ID IS NULL) THEN NEW.AUTHOR_ID = GEN_ID(GEN_NEW_AUTHOR_ID,
>1);
>END ^
>
>CREATE PROCEDURE PROC_NEW_AUTHOR_ID
>RETURNS (THE_NEW_AUTHOR_ID INTEGER)
>AS
>BEGIN
> THE_NEW_AUTHOR_ID = GEN_ID(GEN_NEW_AUTHOR_ID, 1);
>END ^
>SET TERM ; ^
>
>Any ideas what the problem is?

I believe all the code shown above is superfluous. So long as the generator
exists, and you have referenced it in the component as you showed, it
should work. Did you tell the component on which event you want the
generator to be supplied?

Peter Lawson