Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: David Carter <david at SOLBORS dot NO>
Subject: RE: return only a subset of a result
Date: May 22 1998 12:49PM

Hi Albert,

> Well :) If it's post then all I need to do is loop through and skip and
> extract the rows that I want. Not much else you can do I suppose.
> So the time consuming part is the SQL itself. I am working with a
> > 40Gb database from which an average select statement (with filtering)
> will give me about 100,000 rows in return. So my aim is to not show
> everything in 1 go but show them in pages of, say, 10 or 20, at a
> time. Now if there's a way for me to specify which rows of the final
> result set that Sybase will return to me then that'll be idea. It'll be the
> most time efficient way to do it. But can it be done? That's the question.

Yep. Use a cursor in a stored procedure. I had a similar problem. You can
take a look at the end results here: 

I pass two main parameters to the procedure - the page number I want of
the result set and the number of items per page. Sounds like the sort of
thing you're after.

> Thanks :)