Hi,
Can anyone explain how to implement surrogate key concept in Oracle tables?
Thanks...
Printable View
Hi,
Can anyone explain how to implement surrogate key concept in Oracle tables?
Thanks...
I'm not a fan of surrogate keys but evidence shows they are here to stay.
Just take numbers from an Oracle Sequence and populate your key with it.
hi Pavb
Whats wrong with surrogate keys
A surrogate key is nothing but an artificially created PK meaning, you should have a column or group of columns in the affected table already giving you the uniqueness you are looking for.
If you cannot find an unique identifier -column or group of columns- in the affected table I would say that there is a serious issue with your design.
Surrogate Keys are meaningless from the business perspective.
Surrogate Keys are allocating additional space in your table.
Surrogate Keys require you to create a specific process to populate them e.g.: we are adding a level of complexity.
Why would you want to face all these issues when you can easily build a PK using the actual information already sitting in your affected table?
That being said... they are here to stay. Sad, isn't it? : )
Not really, if you have a natural key that is prone to change, then using a surrogate key will prevent you from having to cascade the update of that key. But sequences can certainly add overhead to large transactions.Quote:
Originally Posted by PAVB
I have to agree, you have a point there.
#$%@ I'll have to stop my "de-support sequences campaign" :)
Either way, I'll keep trying to avoid surrogate keys as much as I can.