Re: Identity columns in Oracle?
From: Peter Gurmann <pgurmann_at_via.at>
Date: 1996/06/21
Message-ID: <4qf1b8$tu_at_newsfeed.via.at>#1/1
Date: 1996/06/21
Message-ID: <4qf1b8$tu_at_newsfeed.via.at>#1/1
Eric,
there are two ways to implement this:
1. usage of a SEQUENCE (a DB object which provides unique numbers) and
writing of a DB Trigger which checks whether there is a NULL value, if
yes --> get the next SEQUENCE number. The fastest way but the numbers are
not guaranteed to be consecutive (wasted numbers).
2. getting the max number from that table, add 1 and use it as a new UID.
Performance could be bad but the numbers - because of transaction logic -
are consecutive.