Subject Re: Identity
Author sqlsvr
WOW, So I have to create a trigger for each table which adds another layer of maintenance issues?

In all other DBMS I used, you can simply declare a field as a identity field and it will do the rest.

Is there any other solution to this?


--- In firebird-support@yahoogroups.com, Norman Dunbar <Norman@...> wrote:
>
> On 20/12/10 16:12, sqlsvr wrote:
> > How do I create an autoincrement identity field for each table in Firebird (simple way)?
>
> You don't! ;-)
>
> You create a sequence/generator. That provides the values.
>
> You create a trigger on your table to feed the "id" column from the
> appropriate generator/sequencen when you are inserting (and only when
> you are inserting).
>
> Details of generator/sequences can be found at
> http://www.firebirdsql.org/manual/generatorguide.html.
>
>
> Cheers,
> Norman.
>
> --
> Norman Dunbar
> Dunbar IT Consultants Ltd
>
> Registered address:
> Thorpe House
> 61 Richardshaw Lane
> Pudsey
> West Yorkshire
> United Kingdom
> LS28 7EL
>
> Company Number: 05132767
>