Subject | Re: [firebird-support] Re: Identity |
---|---|
Author | Norman Dunbar |
Post date | 2010-12-20T19:40:50Z |
Evening,
On 20/12/10 16:41, sqlsvr wrote:
> WOW, So I have to create a trigger for each table which adds another layer of maintenance issues?
In a word, yes. Welcome to the world of proper databases - like Oracle
which also doesn't have identity columns. Sequences and triggers there
too I'm afraid. All the best databases work this way ;-)
I'm also not certain that identity data types are part of the sql
standards whereas sequences are.
> In all other DBMS I used, you can simply declare a field as a identity field and it will do the rest.
By the time you've written two triggers and created two sequences,
you'll be able to do it in your sleep.
Or, you could write a procedure to generate the script to build the
sequence and trigger for you.
Or, write once, and simply copy & paste when needed.
The possibilities are (almost) endless.
> Is there any other solution to this?
Trust me, it's really not a problem. Honest - try it.
And as for maintenance problems, what maintenance problems? Keep it
simple, have the trigger do nothing else but allocate the value and
there are no maintenance problems.
Unless you decide to change the name of the trigger of course.
Seriously, give it a try, I'm pretty sure that there are GUI tools out
there that will actually generate a trigger for you. I usually write my
own. By hand. It takes minutes, if that long - but then again, I'm paid
by the hour!! ;-)
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