Re: How to insert sequential number in primary row
I would strongly advise that you do not do this.
The Primary Key value for any record should be allocated / generated when the row is first created and should then remain unchanged until that row is finally and permanently destroyed.
Imagine the chaos if your bank "renumbered" everybody's accounts when someone [else] closed their account!
And, as Barry quite rightly says, you'd also have to change every Foreign Key value that references each and every Primary Key value that you change in this way.
That could be a massive amount of work for your database to do, for no actual benefit. I consider ON UPDATE CASCADE to be a performance killer and never use it.
Regards, Phill W.
Subject
Written By
Posted
Re: How to insert sequential number in primary row
July 15, 2024 01:21AM
Sorry, only registered users may post in this forum.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.