Wednesday, February 27, 2019

Can You Update A Primary Key In Db2






Betreff: [db2-l] updating primary key i need to update the columns in the primary key of a parent table. should i run the update, or should i run a delete/insert? we are on db2 version 8 for z/os just thinking of a table with a primary key. you are correct if you are using db2 "system ri". troy. The first one wont allow you to update the key when there is a dependant key, the second also does the same9almost), while the third one modifies the dependant foreign key also with the new value of your parent key.. Db2 uses a unique index to enforce the constraint during the execution of the load utility and whenever you use an insert, update, or merge statement to add or modify data. every unique key is a key of a unique index..





Notes from Rational Support Blog


Notes from rational support blog



One other thing you need to consider. if the update of adding 10 to each key value will result in duplicate values of this column at any point in time then you are going to have issues with violating the primary key so you may end up having to deal with that as well. on this point, the foreign key issue may turn out to be academic.. Answer / guest. primary key value can be updated as well provided the value you update it with identifies it uniquely.. The primary key of the conceptual data model should have the attributes given in the answers from the link you provided but may be different from the final physical primary key (familiarity for example is not imo a criteria for the primary key of the actual table). my answer relates to the primary key of the physical model..



can you update a primary key in db2

visit link reference



0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.

 

Copyright © Genie Download Design by Free CSS Templates | Blogger Theme by BTDesigner | Powered by Blogger