Saturday, February 25, 2012

Returning small managable sets from a SELECT statement

I have a Database that contains 10,000 records. I execute a SELECT statement that returns 8000. I need those 8000 and cannot refine my statement to return a smaller subset.

My problem is I don't want all the results back in one go. I would like to return to 1000 rows on my first call. On my second call I would like another 1000 rows starting from the end of the last call and so on...

Is this possible? Also the table has no unique key either, and that ain't gonna change.

Any suggestions. I would like to implement this in SQL.

Thanks in advance to anyone who comes up with a good solutionHello,

you can use PL/SQL to open a cursor an fetch the records block wise ..

Use

OPEN, FETCH and CLOSE statements to create a package and use this in your application.

Hope that hint helps ?

Manfred Peter
(Alligator Company GmbH)
http://www.alligatorsql.de

No comments:

Post a Comment