View previous topic :: View next topic |
Author |
Message |
sraj Beginner
Joined: 08 Aug 2006 Posts: 10 Topics: 4
|
Posted: Tue Nov 20, 2007 9:47 pm Post subject: DECLARE cursor clause based on parameter |
|
|
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 |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Wed Nov 21, 2007 2:53 am Post subject: |
|
|
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 |
|
 |
sraj Beginner
Joined: 08 Aug 2006 Posts: 10 Topics: 4
|
Posted: Wed Nov 21, 2007 9:16 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
|
Posted: Wed Nov 21, 2007 10:31 am Post subject: |
|
|
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 |
|
 |
|
|