Subject | Re: [firebird-support] Autoincremented Fields in Delphi |
---|---|
Author | Mitchell Peek |
Post date | 2005-07-15T22:43:09Z |
gato2707 wrote:
Create Generator gen_MYNAME;
>Hi everybody:No, a trigger.
>
>I'm trying to use an autoincrement field in a table, the field is part
>of the primary key. First I used a trigger calling a generator, but
>when insert a new record in my Delphi application i discover is
>neccesary to write any value in the field BEFORE the post operation,
>otherwise an error occurs. Then I read best way to do that is thru a
>StoredProcedure, well, I cant't find where call that procedure. Any
>sugestion?
>
>
>
Create Generator gen_MYNAME;
>CREATE TABLE MYNAMESif (new.mycode is null) then
>(
> MYCODE INTEGER,
> MYNAME CHAR(30)
>)
>
>CREATE trigger t_myname_bi for myname before insert as
>AS
>BEGIN
>
>
> NEW.myCODE = GEN_ID(gen_myname, 1);
>END
>
>
>
>
>
>