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

Ascending Cursor for multiple index


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Mon Apr 06, 2009 3:22 am
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top