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 Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm


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