Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
DB2 PRIMARY Key Update in COBOL code

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

New User


Joined: 11 Sep 2007
Posts: 65
Location: Gurgaon

PostPosted: Mon Aug 20, 2012 11:06 pm    Post subject: DB2 PRIMARY Key Update in COBOL code
Reply with quote

Is it possible to update DB2 Primary Key field in DB2 Cobol code with a unique value?
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Aug 20, 2012 11:41 pm    Post subject:
Reply with quote

Hello,

If i understand your question, NO - the primary key cannot be updated. This has nothing to do with COBOL.

Searching in the db2 part of the forum might have lead you to this previous topic:
http://ibmmainframes.com/viewtopic.php?t=11822&highlight=change+primary+key

Please ignore this post - it is NOT correct
d
Back to top
View user's profile Send private message
raj_mainframe08

New User


Joined: 11 Sep 2007
Posts: 65
Location: Gurgaon

PostPosted: Mon Aug 20, 2012 11:44 pm    Post subject:
Reply with quote

Thanks Dick. I also have the same feeling untill i read below page. So thought of confirming.

http://www.allinterview.com/showanswers/83989.html
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Aug 21, 2012 1:03 am    Post subject:
Reply with quote

Primary keys can be changed, the new value must unique and be careful of foreign key constrains.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Aug 21, 2012 1:04 am    Post subject: Reply to: DB2 PRIMARY Key Update in COBOL code
Reply with quote

Ooops - looks like my bad . . . icon_redface.gif

d
Back to top
View user's profile Send private message
Jaggu.r

New User


Joined: 07 Aug 2012
Posts: 2
Location: India

PostPosted: Tue Aug 21, 2012 5:46 pm    Post subject: Reply to: DB2 PRIMARY Key Update in COBOL code
Reply with quote

Yes. We can do that.

We can DROP and ALTER primary key of a DB2 Table.

Try to create a cobol program with static sql with ALTER table query to do this but there is a constraint in using this. You need excess authorization for this.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Aug 21, 2012 7:54 pm    Post subject:
Reply with quote

Hello and welcome to the forum,

Please re-read the topic. Your reply does not address the question asked.

It is best to ensure the question is understood before posting a reply.
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
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us