MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DECLARE cursor clause based on parameter

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
sraj
Beginner


Joined: 08 Aug 2006
Posts: 10
Topics: 4

PostPosted: Tue Nov 20, 2007 9:47 pm    Post subject: DECLARE cursor clause based on parameter Reply with quote

DECLARE CURSOR csr1 <SCROLL/NOSCROLL> CURSOR
FOR SELECT col1, col2
FROM table1


Is it possible to parameterize the SCROLL value in DECLARE cursor based on a input to program.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Wed Nov 21, 2007 2:53 am    Post subject: Reply with quote

you obviously felt that your time was better spent posting a question on the internet instead of looking at the appropriate db2 manual for you db2 version.

i think your time would be better spent either looking at a manual or just plain coding and testing.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
sraj
Beginner


Joined: 08 Aug 2006
Posts: 10
Topics: 4

PostPosted: Wed Nov 21, 2007 9:16 am    Post subject: Reply with quote

dbzTHEdinosauer wrote:
you obviously felt that your time was better spent posting a question on the internet instead of looking at the appropriate db2 manual for you db2 version.

i think your time would be better spent either looking at a manual or just plain coding and testing.



I'm testing various options mentioned in manual. Just trying to find if someone already used such feature.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Wed Nov 21, 2007 10:31 am    Post subject: Reply with quote

sraj,

If you do not want to deal with dynamic SQL then define 3 cursors each with a different order by clause and open the cursor based on the parameter. At any given point of time you will open only one cursor.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group