Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Solution required...

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
Author Message
ajitkumar

New User


Joined: 03 Feb 2006
Posts: 1
Location: Chennai

PostPosted: Sun Feb 05, 2006 8:38 am    Post subject: Solution required...
Reply with quote

Hi,

could anyone please resolve the problem as mentioned under :

I have millions of record in a table, but just want to skip first 29 records and then fetch only 30 records.
Back to top
View user's profile Send private message
References
pa1chandak
Currently Banned

Active User


Joined: 31 Jan 2006
Posts: 55

PostPosted: Mon Feb 06, 2006 9:43 am    Post subject:
Reply with quote

use

skiprec(29)
and stopafter(30)


pawan
Back to top
View user's profile Send private message
umeshkmrsh

Active User


Joined: 21 Sep 2005
Posts: 81
Location: India

PostPosted: Mon Feb 06, 2006 4:42 pm    Post subject:
Reply with quote

See as the data in a DB2 table is considered unordered if you are not using an ORDER BY clause.

In case you are using one
(1) One way is to use cursor and skip the first 29 rec and then process next 30 records.

(2) Or you can try this link

http://forums.devshed.com/db2-development-114/row-offset-and-fetch-first-rows-157033.html


Regards,
Umesh
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1