sql - How do I rename primary key values in Oracle? -
Our application uses an Oracle 10g database where many primary keys come in front of the end user, product code and such misfortune It is late in doing anything with it because there are so many reports and custom scripts that we do not have control. We can not redefine the primary key or mess up the database structure.
Now some customers want to change some primary key values. They initially wanted to call P23A1, now it should be called Cat 23 MOD 1 (not a real example, but you get my meaning.)
Is there an easy way to do this? I prefer a script that can be parametred to fit other tables and keys, but external equipment will be acceptable if there is no other way.
The problem is probably with foreign keys in terms of PK
- Settle the obstacles
- Modify the parent, in the form described in this Tom Kite article, you should define foreign keys as "instant in the beginning".
- Modify child values
- Earn changes
Simple.
Comments
Post a Comment