Thread: Oops...
With respect to my previous query, I'd like to clarify that the FETCHes I am doing are subsets of the full results (hence I cannot use PQntuples). For instance, I am FETCHing 25 records out of a possible 1000, so PQntuples() is returning 25. I need some way of knowing there's a 1000 total. Thanks, Mike. ====================================================================== Mike Frisch Email: mfrisch@saturn.tlug.org Northstar Technologies WWW: http://saturn.tlug.org/~mfrisch Newmarket, Ontario, CANADA ======================================================================
On Sat, 10 Apr 1999, Mike Frisch wrote: > With respect to my previous query, I'd like to clarify that the FETCHes I > am doing are subsets of the full results (hence I cannot use PQntuples). > For instance, I am FETCHing 25 records out of a possible 1000, so > PQntuples() is returning 25. I need some way of knowing there's a 1000 > total. Why can't you get the number of the initial results before fetching them page by page? If you create an initial query and save it as a view, why can't you grab the number out of that first result set (via a ntuples function call or by executing an SQL statement), then page through it with your cursor? Or can cursors not be created from views? Brett W. McCoy http://www.lan2wan.com/~bmccoy/ ----------------------------------------------------------------------- If the human brain were so simple that we could understand it, we would be so simple we couldn't.
simple - first try "select count(*) from ...", and then "declare ..." and subsequent fetches. Mike Frisch napisał(a): > > With respect to my previous query, I'd like to clarify that the FETCHes I > am doing are subsets of the full results (hence I cannot use PQntuples). > For instance, I am FETCHing 25 records out of a possible 1000, so > PQntuples() is returning 25. I need some way of knowing there's a 1000 > total. > > Thanks, > > Mike. > > ====================================================================== > Mike Frisch Email: mfrisch@saturn.tlug.org > Northstar Technologies WWW: http://saturn.tlug.org/~mfrisch > Newmarket, Ontario, CANADA > ====================================================================== -- Marcin Grondecki ojciec@mtl.pl (604)468725 *** I'm not a complete idiot - some parts are missing