Subject | Re: Identity |
---|---|
Author | Thomas |
Post date | 2010-12-20T22:37:34Z |
--- In firebird-support@yahoogroups.com, Lester Caine <lester@...>
That gives you actually the best of both worlds: the "comfort" of autoincrement and the flexibility of sequences.
> But it is much more PRACTICAL since it allows you to do cleaver things likeI like PostgreSQL's solution: you can define the default value for a column based on a sequence. And it supports a "short hand" notation for that, which also ties the sequence to that column - which means the sequence will automatically be dropped if the table is dropped
> populate subdetail table entries using the SAME value you access from the
> generator. You don't know the value of an 'auto-incremented' field until AFTER
> it has been committed! Even better, you can use one generator for several key
> fields, which in my own designs is another useful facility.
That gives you actually the best of both worlds: the "comfort" of autoincrement and the flexibility of sequences.