| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: FK -> non PK - bad design?
In message <5606b639.0304090641.2282467f_at_posting.google.com>, OtisUsenet
<otis_usenet_at_yahoo.com> writes
>
>I wanted to have a database-generated ID for each row just for sanity,
>and because an Oracle DBA once told me it is always good to have a
>db-generated id/PK in each table.
This issue crops up here about once a month but I don't recall anyone saying that they did it for reasons of sanity.
The brief version of the argument against using a system generated numeric and a separate text field is that you need to have a system to keep the two synchronised. That's more work and more error-prone than just using your Type field as a PK.
Sometimes there are good reasons to choose a system generated ID but I'd recommend that you avoid them if you have a real key available in the data.
-- Bernard Peek bap_at_shrdlu.com www.diversebooks.com: SF & Computing book reviews and more..... In search of cognoscentiReceived on Wed Apr 09 2003 - 15:46:49 CDT
![]() |
![]() |