Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Inserting a new PK into an existing table
David Newman wrote:
> "Mark D Powell" <Mark.Powell_at_eds.com> writes:
>
>> Jens Lenge wrote: >> >> Normally we use a business column or set of column values in the table >> to be the PK and do not use an artificial key since if a unique >> business value exists there is no need for or real use of an artificial >> key. >>
Java is sustained by people whose knowledge of relational databases is at about the level at which philosophy is taught to 4th graders.
Essentially you have a choice between natural keys and surrogate keys. If you use a natural key, for example a tax identification number, it must conform to the rules for a primary key in the database in which you are working. If there is no natural key, and I would argue ONLY if there is no natural key, would I resort to using a surrogate key which is usually an incremented integer (in Oracle generated by a sequence object). One of the biggest problems with surrogate keys is that they are incapable, without natural keys, of eliminating duplicates in column other than their own.
I would give the opinions of those coming from Hibernate all the time it deserves: None!
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Thu Aug 31 2006 - 13:31:29 CDT