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
 

 

Ascending Cursor for multiple index

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

New User


Joined: 01 Sep 2005
Posts: 5
Location: Mysore

PostPosted: Sun Apr 05, 2009 8:44 pm    Post subject: Ascending Cursor for multiple index
Reply with quote

Hi,

I need to code a ascending cursor for a table with the following index,

DATE
TYPE
PRICE
CONTRA (NULL exist)
ADD_TIMESTAMP

Can anybody help me in writing a cursor to fetch the rows in an ascending pattern. My ORDER_BY preference would be in the order mentioned above.


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

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Apr 06, 2009 3:22 am    Post subject:
Reply with quote

Hello,

Where is the difficulty? Declare the cursor as

select from..
where. . .
order by . . .

If you are having problems (syntax or undesired sql return codes), post your code and the error(s) and someone will be able to clarify.
Back to top
View user's profile Send private message
yourchoice_amit

New User


Joined: 01 Sep 2005
Posts: 5
Location: Mysore

PostPosted: Mon Apr 06, 2009 9:09 pm    Post subject:
Reply with quote

how do i give a WHERE clause for CONTRA which has NULL values and VALID Alpha numeric in it.
???
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Mon Apr 06, 2009 9:55 pm    Post subject:
Reply with quote

Amit .. are you concerned about your order by or where clause ...
post the current SQL and the problem you are facing with an example ...
it would be easy for us to help ...
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 Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts setting new limit Key values for inde... srilata83 DB2 1 Fri Feb 10, 2017 9:24 pm


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