View previous topic :: View next topic
|
Author |
Message |
Prasad Toshniwal Warnings : 1 New User
Joined: 05 May 2008 Posts: 4 Location: PUNE
|
|
|
|
Hi,
There is one table containing 50 rows and i want to fetech only first 20 rows.
Is it necessary to use cursor here if yes then what would be my query and declarations if required.
Thanks,
Prasad |
|
Back to top |
|
|
anil.csk
New User
Joined: 22 Oct 2007 Posts: 16 Location: Noida
|
|
|
|
when you go declare the cursor
declare a1 cursor for select .....where ... for fetch first 20 rows. |
|
Back to top |
|
|
Prasad Toshniwal Warnings : 1 New User
Joined: 05 May 2008 Posts: 4 Location: PUNE
|
|
|
|
Anil,
Thanks. As i am new in DB2 could you please elaborate more on this.
Thanks,
Prasad Toshniwal |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Prasad Toshniwal
Please post in the correct forum.
Topic moved to the correct forum. |
|
Back to top |
|
|
anil.csk
New User
Joined: 22 Oct 2007 Posts: 16 Location: Noida
|
|
Back to top |
|
|
umasankar.eee06
New User
Joined: 04 Sep 2008 Posts: 11 Location: chennai
|
|
|
|
Hi prasad,
U can use OPTIMIZE FOR 20 ROWS in fetch declaration. |
|
Back to top |
|
|
|