I need to change the primary key for an already existing DB2 table .
My doubt is if I change the primary key using the Alter table command , do the index for this new key will be generated or not ? . Now after the alteration how will the Select statements on this table work .. ?will it be using the new Key while selection.Please clarify on this .. Thanks in advance
Joined: 25 Jan 2004 Posts: 160 Location: Toronto, Canada
first step is to identify the list of programs where the impacted DB2 table
Second is to analyse what kind of DDL statements used in each of the
program and create a report of it.
If the new filed, is not going to be a part of Index, then Delete/Update
statements will not be affected.
Insert/Select will be impacted based on the usage of the filed
Take an image copy of the table.
Drop the table
Create a new table defination
Load the table from the previous image copy /* here the format differs
so you may use one time program to load this, otherwise you can chagne the syspunch and load*/
now you need to modify the impacted program.
Compile, link-edit and bind all the programs where the table is used.
let me know if you require any additional information.