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 IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts To know activities on db2 tables ashek15 DB2 4 Fri Mar 03, 2017 11:23 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm


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