Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: limiting number of rows returned in sql query
bvh2_at_swbell.net (bvh) wrote in message news:<3d12fc4b.117682588_at_news.supernews.com>...
> Is there a way to limit the number of rows returned in a query?
>
> For example, I have a system that has 2,000 records in it. I want to
> pull those records in a batch process 500 at a time with software that
> will do scheduled sql queries -- I just need to figure out how to
> limit the record numbers returned without changing the design to the
> database (its a third party app's database).
>
> Thanks!
It seems to me your options are limited based on the ability of the
scheduling software to handle and run a query. If you were writing
the code yourself then
the following would be options to consider. I see the problem as
identifing the rows to be extracted in each operation, which appears
to me that you want it done in four separate steps.
1 - If you are on a UNIX system just extract all the rows and use UNIX utilities like 'split' to break the file up
2 - If four jobs will be used to extract the data then you could schedule a process that scans the data and determines either the PK values or rowids that relate to the target ranges. This information would be saved to a query control table. The scheduled queries would then extract one range based on the end-range (or may begin and end range) values stored in the query control table.
Just a couple of ideas. -- Mark D Powell -- Received on Fri Jun 21 2002 - 09:02:57 CDT
![]() |
![]() |