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 cursor query in COBOL-DB2 Program

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

New User


Joined: 09 May 2005
Posts: 18

PostPosted: Tue Sep 12, 2006 8:26 pm    Post subject: Update cursor query in COBOL-DB2 Program
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    Post subject: Re: update cursor in COBOL
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    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
No new posts Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
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
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm


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