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
 

 

Cursor order by 1

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

New User


Joined: 22 May 2007
Posts: 68
Location: mumbai

PostPosted: Mon Jan 12, 2009 10:43 am    Post subject: Cursor order by 1
Reply with quote

Hi ,

i want to know what does teh syntax below means i.e order by 1

Code:
EXEC SQL   
     DECLARE Z1 CURSOR WITH HOLD FOR
            SELECT I_ACCT                       
                  ,C_TYP_REQ                     
                  ,C_AUCTN_HSE                   
              FROM Z.ZCTTTLQ                     
             WHERE I_ACCT = :TEMP-ACCT           
           AND NOT C_TYP_REQ = 'P'               
          ORDER BY 1                             

END-EXEC       

Thanks,
Jaspal

Edited: Please use BBcode when You post some code/error, that's rather readable, Thanks... Anuj
Back to top
View user's profile Send private message

Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1239
Location: Richfield, MN, USA

PostPosted: Mon Jan 12, 2009 10:52 am    Post subject:
Reply with quote

Click on IBM Manuals at the top of the screen and look at the DB2 SQL Reference Manual.
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Mon Jan 12, 2009 3:08 pm    Post subject:
Reply with quote

It means order by first col ... which is I_ACCT
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Jan 12, 2009 3:17 pm    Post subject: Reply to: Cursor order by 1
Reply with quote

Hi,

Teryy has given you a right direction, however here is a rather polite day for me..so check this link & search on "By 1"

http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db29.doc.sqlref/db2z_sql_fullselect.htm

Good Luck.
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 Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am
No new posts SQL Order By related question Joseph K Thomas DB2 8 Fri Mar 18, 2016 12:53 pm
No new posts DB2 Stored Procedure - Dynamic SQL - ... GuyC DB2 2 Wed Feb 17, 2016 5:10 pm


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