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

Update cursor query in COBOL-DB2 Program


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
komal

New User


Joined: 09 May 2005
Posts: 17

PostPosted: Tue Sep 12, 2006 8:26 pm
Reply with quote

Hello all,

I run one query in SPUFI for updating table. It is like

UPDATE CO.TAB1 SET COLT = 'TEST' WHERE MOD(LO-ID , 210) = 0;

Where the table having 3 lak records and i want to update every 210th record. And in the above query lo-id(integer) is primary key where as the table having composite primary key.

This query executed fine.

I tried the same quiery in COBOL-DB2 program where as its showing errors.

Anybody plz help me to run this in my program. If possible Using cursor and without using cursor.

And also give me a db2 query to run in COBOL for fetching every nth row.

Thqnq
Kiran
Back to top
View user's profile Send private message
kgumraj

Active User


Joined: 01 May 2006
Posts: 151
Location: Hyderabad

PostPosted: Tue Sep 12, 2006 9:45 pm
Reply with quote

As, pre my knowledge I dont know if their is a query to update a nth row. But through Cobol you can get the same using counter.

For ex:

PERFORM VARING I BY nth row UNTIL <CONDITION>
DIVIDE I BY nthrow REMINDER J
IF J = 0
UPDATE sql
ELSE
CONTINUE
END-PERFORM.
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
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
Search our Forums:

Back to Top