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
 

 

What is Spufi equivalent to SKIPAFT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
ywheeler

New User


Joined: 10 Nov 2006
Posts: 19
Location: New York

PostPosted: Thu Apr 28, 2011 10:13 pm    Post subject: What is Spufi equivalent to SKIPAFT
Reply with quote

I want to select from a table x-nbr of rows after skipping the first x-nbr of rows. Like this...

Select *
From db2table.abcd
skip first 10000 rows
fetch 1000 rows
;

Can this be done?
Thanks.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Thu Apr 28, 2011 10:24 pm    Post subject: Reply to: What is Spufi equivalent to SKIPAFT
Reply with quote

SKIPAFT
just curious... in what language did You find the SKIPAFT function ???
Back to top
View user's profile Send private message
ywheeler

New User


Joined: 10 Nov 2006
Posts: 19
Location: New York

PostPosted: Thu Apr 28, 2011 11:07 pm    Post subject:
Reply with quote

SKIPAFT- Its either sort or fileaid I don't remember right now.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Fri Apr 29, 2011 1:53 pm    Post subject:
Reply with quote

at minimum you would need an "order by"
without order by the first n rows is meaningless.
In Spufi/qmf
Code:
select * from
(select T.*,row_number() over (order by col1) as rn from table1 T) A
where rn  between 10001 and 11001

or if you don't want to order by
Code:
select * from
(select T.*,row_number() over (order by 1) as rn from table1 T) A
where rn  between 10001 and 11001


In an application program I would use "scrollable cursors"
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 SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts Problems in File-Aid / DB2 Spufi whil... amitc23 CLIST & REXX 6 Fri Feb 12, 2016 1:59 pm
No new posts Not able to access the DB2 via SPUFI sakthikumarT DB2 6 Sat Nov 28, 2015 1:52 am
No new posts DB2 program returned data is dif than... pradeepkit DB2 1 Tue Mar 03, 2015 5:39 am
No new posts How to skip foriegn Key constraint in... Arunkumar.chinnappa DB2 5 Fri Feb 07, 2014 2:17 pm


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