IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

update in cobol for DB2 tables


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top