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


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.

btw, the pseudo column ROWID (phys addr of the row) may be something like a Identity column, but NEVER use it for referential integrity, after imp/exp ROWIDs change !

good luck !

Peter Received on Fri Jun 21 1996 - 00:00:00 CEST

Original text of this message