Subject Re: [firebird-php] Re: using auto_number field
Author Jean Lopes - TSA

Yes, I ask the generator before, then I had the generator to use in master
record and details to create the foreign key.

But if you had a trigger before insert (for auto-inc) like new.cod_key =

the filed cod_key will be updated a second time.

Jean Paul Lopes

TSA Tecnologia Sistemas e Automação Ltda.
Rua Cel Sarmento, 1699 / 101
94010-031 - Gravataí - RS
Fone/Fax: 51 488.3608 / 3042.6084

Membro da Comunidade Firebird de Língua Portuguesa
Fazendo o Firebird falar português
----- Original Message -----
From: "Alan McDonald" <alan@...>
To: <>
Sent: Friday, June 04, 2004 4:48 PM
Subject: RE: [firebird-php] Re: using auto_number field

> >remember that when you use trigger to implements auto-inc field, you
> >have control over the
> >value. It is a problem qhen you use master-detail relationships. In my
> >databases mny trigger had a
> >test. If de value of a auto-inc is null or 0 (zero) then get a new
> >enerator, othewise the aplication
> >get the generator first and, with the value "in hands", send it to
> >in the insert command. then
> >I had the key value for details.
> >Diferents problems requires diferents solutions. One touch wizzard always
> >resolves thr problems
> >in the same way.
> >Jean Paul Lopes
> >Sócio-Gerente
> Rubbish.. you just ask for the generated value before you insert. Then you
> have it for the detail records as well.
> ever seen
> ?
> Alan
> Yahoo! Groups Links