Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
FOR UPDATE and ORDER BY

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

New User


Joined: 15 Feb 2010
Posts: 1
Location: Chennai

PostPosted: Fri Jul 02, 2010 1:08 pm    Post subject: FOR UPDATE and ORDER BY
Reply with quote

Hi,

Is it possible to use FOR UPDATE option and ORDER BY in the same declare statment. I want to update all the rows of the table. As my table might not be in sorted order.

EXEC SQL
DECLARE PRC-CRS CURSOR WITH HOLD FOR
SELECT DISTINCT T1.ITM_NBR
FROM A.ET_STK_LCT_PRC T5710
WHERE A.LC_NBR = :T3-LC-NBR
FOR UPDATE
END-EXEC.

Is FOR UPDATE is not necessary, will the declare cursor default to UPDATE option?

Thanks
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Fri Jul 02, 2010 1:24 pm    Post subject:
Reply with quote

you can only ORDER BY read only cursors.

as far as the FOR UPDATE clause, suggest you start reading here
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 Sorting on text - but in non-alphabet... Roy Ware SYNCSORT 5 Wed Aug 23, 2017 9:15 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
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 Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us