Re: Re: DataObject compatibility
| From: | Mika Tuupola | Date: | Fri, 27 Jun 2003 09:33:16 +0000 |
| Subject: | Re: Re: DataObject compatibility | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-6279@lists.php.net to get a copy of this message | ||
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);
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.
--
Mika Tuupola http://www.appelsiini.net/~tuupola/