Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need help to change primary key !!!

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
RamyaG

New User


Joined: 29 Sep 2004
Posts: 1

PostPosted: Wed Sep 29, 2004 12:16 pm    Post subject: Need help to change primary key !!!
Reply with quote

Hai ,


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

Regards,
Ramya
Back to top
View user's profile Send private message

jz1b0c

Active User


Joined: 25 Jan 2004
Posts: 160
Location: Toronto, Canada

PostPosted: Sat Nov 13, 2004 2:21 am    Post subject:
Reply with quote

first step is to identify the list of programs where the impacted DB2 table
is used.

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.
_________________
Masade,

A Well defined problem is half solved.
Back to top
View user's profile Send private message
jz1b0c

Active User


Joined: 25 Jan 2004
Posts: 160
Location: Toronto, Canada

PostPosted: Sat Nov 13, 2004 2:21 am    Post subject:
Reply with quote

Yes you have to use the new key while making selection after the alter
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts How to change dataset attributes of m... ignich7 JCL & VSAM 3 Thu Jul 21, 2016 9:17 pm
No new posts SFTP to primary and secondary servers mallik4u JCL & VSAM 4 Tue Jun 07, 2016 12:52 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us