Home » RDBMS Server » Server Administration » Re: Update, constraint restruction, workaround...
Re: Update, constraint restruction, workaround... [message #375251] Sun, 12 August 2001 14:50
Sudhakar Atmakuru
Messages: 58
Registered: May 2001
Member
Here is a couple of tips you could do to resolve your problem. If you are using ORACLE8 or above (if not, i am not sure about it so you check it up in that older versions), you can directly update the table with a change in your primary key directly as you would do to others in the same table. Otherwise, if it restricts you to do so, you could disable the primary key constraint by ALTER TABLE table_name DISABLE PRIMARY KEY and proceed with the update and then enable the PRIMARY KEY constraint immediately. And for subsequent updates in other tables, I guess, you could do in another way, that is, create a temp table with two columns OLDNAME and NEWNAME and write an update statement for each table updating with NEWNAME where it finds OLDNAME. Since ORACLE's UPDATE does not allow you to update multiple tables at one shot, you have to write the update statements the number of tables to be updated or a pl/sql block to do so at one run. Hope you got my point. Try it out.
Good luck.
Previous Topic: where exists elimination
Next Topic: Slow query - but only when query on certain values
Goto Forum:
  


Current Time: Tue Dec 24 07:20:16 CST 2024