Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDC-1558: MSSQL2000 setFirstResult() Bug #2193

Closed
doctrinebot opened this issue Dec 23, 2011 · 2 comments
Closed

DDC-1558: MSSQL2000 setFirstResult() Bug #2193

doctrinebot opened this issue Dec 23, 2011 · 2 comments
Assignees
Labels

Comments

@doctrinebot
Copy link

Jira issue originally created by user dingdangjyz:

$q = $em->createQuery("select c from Entities\CityGuide c")->setFirstResult(3)->setMaxResults(10);
$user = $q->getResult();

Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: [Microsoft][SQL Server Native Client 10.0][SQL Server]'ROW_NUMBER' Not a recognized function name。' in E:\xampp\htdocs\D\Doctrine\DBAL\Connection.php:618 Stack trace: #0 E:\xampp\htdocs\D\Doctrine\DBAL\Connection.php(618): PDO->query('SELECT * FROM (...') #1 E:\xampp\htdocs\D\Doctrine\ORM\Query\Exec\SingleSelectExecutor.php(46): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM (...', Array, Array) #2 E:\xampp\htdocs\D\Doctrine\ORM\Query.php(249): Doctrine\ORM\Query\Exec\SingleSelectExecutor->execute(Object(Doctrine\DBAL\Connection), Array, Array) #3 E:\xampp\htdocs\D\Doctrine\ORM\AbstractQuery.php(607): Doctrine\ORM\Query->_doExecute() #4 E:\xampp\htdocs\D\Doctrine\ORM\AbstractQuery.php(413): Doctrine\ORM\AbstractQuery->execute(Array, 1) #5 E:\xampp\htdocs\D\y.php(67): Doctrine\ORM\AbstractQuery->getResult() #6 {main} thrown in E:\xampp\htdocs\D\Doctrine\DBAL\Connection.php on line 618

@doctrinebot
Copy link
Author

Comment created by @beberlei:

We don't really support SQL Server 2000 anymore (>= 2005).

This is one case, however SQL Server 2000 itself does not support limit with offsets itself (at least i found no way). However if you have a way, you can create your own database platform extending Doctrine\DBAL\Platforms\MsSQLPlatform and overriding the modifyLimitQuery() method.

@doctrinebot
Copy link
Author

Issue was closed with resolution "Invalid"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants