in reply to Re: Class::DBI Pagination with Table Joins
in thread Class::DBI Pagination with Table Joins

I thought that pagination meant giving the data to a user a chunk at a time. Which is why your post confuses me; you say "don't do that" and then say "here's how to impliment pagination".

Also, I don't think that LIMIT is as universal as you might think. It works in Postgres and MySQL, but I know that it doesn't work in Sybase at the time of this writing.

thor

Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come

  • Comment on Re^2: Class::DBI Pagination with Table Joins

Replies are listed 'Best First'.
Re^3: Class::DBI Pagination with Table Joins
by pboin (Deacon) on Oct 13, 2005 at 15:18 UTC

    You're right, I wasn't clear, sorry. What I meant was: Yes, do the pagination, but No, don't pull X-thousand records to do it. Paginate by pulling only what you need. (Think Just-In-Time inventory, except w/ records.)

    I can't speak Sybase SQL, and we all know that sometimes SQL seems like it's more dialect than ANSI. I've used LIMIT and OFFSET with success in my own work though, and it's *really* handy for this kind of work.

      Howdy!

      Last time I did Sybase, one could "set recordcount=x" to limit the result set to x rows, but I don't recall any analog to OFFSET. Of course, if you do pagination by repeated queries, how worried are you about getting the same result set each time (from which you draw a different subset)? If the data is fairly static, or you don't care, you can just do a fresh query each time. Otherwise, you want an iterator-like middleman to do the big query and hand you x rows at a time on demand.

      yours,
      Michael