Sunday, June 9, 2019






Sorry i did not pay attension to your sentence 'can we update the key field addr as mentioned below,' as far as i know changing the value of any primary key would result in a new row. primary key is the field is the basis for selection of rows, so how can you change the value for the same.. I have 2 tables , please check images attached. pk: fk: p_id in pk table is the primary key and p_id in fk table is the foreign key. i need to add 10 to all records in p_id column of both pk and fk table( meaning they need to match always). Only one primary key is allowed in a table, you can not have two primary keys in a table. but you can have one primary key with n number of foreign keys in a table. let me know if any issues. regards, dj.





Notes from Rational Support


Notes from rational support



"hi, i am adding the identity column for the existing table with generated always in db2 luw v10.1. and this is not a part of any constraint or primary key.. I design the database tables, such that the primary key is a number field that keep incrementing, like a sequence number. then i make a unique index on the table column values, and cluster on that index.. Answer / guest. primary key value can be updated as well provided the value you update it with identifies it uniquely..



can we update primary key in db2

visit link reference



8:53 AM   Posted by gaget with No comments

0 comments:

Post a Comment

Search