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

FOR UPDATE and ORDER BY


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 6966
Location: porcelain throne

PostPosted: Fri Jul 02, 2010 1:24 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Rotate partition-logical & physic... DB2 0
No new posts Read a flat file and update DB2 table JCL & VSAM 2
No new posts how to update an ISR appl var from an... TSO/ISPF 8
No new posts DB2 Load - Sort Or order BY DB2 1
No new posts GDG all in sequence order JCL & VSAM 9
Search our Forums:

Back to Top