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
 

 

update in cobol for DB2 tables

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
gireesh.behara

New User


Joined: 09 Jul 2008
Posts: 2
Location: chennai

PostPosted: Wed Jul 09, 2008 2:56 pm    Post subject: update in cobol for DB2 tables
Reply with quote

Hi all

I am facing one problem while using the update statement in cobol.

Eg

Update EMP set sal=5000 where EMPID in(EMPLoyee ID's are in COBOL array)

How do i execute the above query for set of ID's

Any help would be greatful
Back to top
View user's profile Send private message

Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Wed Jul 09, 2008 3:49 pm    Post subject: Reply to: update in cobol for DB2 tables
Reply with quote

Hi,

You can do this in a loop with a varying index.

Code:
PERFORM UPDATE-PARA VARYING WS-INDX FROM 1 BY 1
UNTIL WS-INDX = X (Maximum value of the array)


UPDATE-PARA.

UPDATE EMP set sal=5000 where EMPID = WS-EMP-ID-ARR(WS-INDX)
Back to top
View user's profile Send private message
rag swain

New User


Joined: 17 Dec 2007
Posts: 33
Location: pune,INDIA

PostPosted: Thu Jul 17, 2008 4:36 pm    Post subject: Reply to: update in cobol for DB2 tables
Reply with quote

Is this a static or dynamic array? The no of EMPID keeps on changing each time or is it constant?
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Thu Jul 17, 2008 4:46 pm    Post subject:
Reply with quote

Quote:

Is this a static or dynamic array?


?

Quote:

The no of EMPID keeps on changing each time or is it constant?


ans

Quote:

How do i execute the above query for set of ID's
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm


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