Re: Re: DataObject compatibility

From: Date: Fri, 27 Jun 2003 09:46:41 +0000
Subject: Re: Re: DataObject compatibility
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-6280@lists.php.net to get a copy of this message
Mika Tuupola wrote:
On Fri, 27 Jun 2003, Markus Wolff wrote:
If I understand the code right, all I need to do is add the modifyLimitQuery() method to PEAR::DB´s MSSQL driver class to make it work, is that correct? If so, I think I know a way to make limit() work with MSSQL as well.
Not correct (AFAIK). MSSQL has the TOP keyword instead of LIMIT but that does not support offset. Thus PEAR DB does not have modifyLimitQuery() for MSSQL driver. However PEAR DB already does have working support for LIMIT in MSSQL driver via emulation. You can call it by using limitQuery(). So instead of using something like (which works with Postgres and MySQL but not MSSQL): $query = $dbh->modifyLimitQuery($query, $from, $count); $result = $dbh->query($query);
at the moment, DataObjects has a very limited usage of limitQuery, it calls it when you do $object->limit(1,100); - rather than when it builds the query.. - it wouldnt take too much to change that though - just store the 1,100 as an array in _limit, and call modifyLimitQuery in the find() method.. another one on the todo list.. Regards Alan
You should do (which also works with MSSQL). $result = $dbh->limitQuery($query, $from, $count); This is how I achieved working limit for MSSQL in DB_DataContainer.
-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com

« previous php.pear.general (#6280) next »