0

It seems that ZF2 with the PDO:dblib driver defaults to using the SQL92 SQL decorator. How do I use the DI system to tell it to use the SqlServer decorator instead? Just can't get my head around it.

The issue is that the paginator attempts to use LIMIT/OFFSET syntax which doesn't work in SQL Server.

Another way of phrasing it is how do I customise the Paginator returned from fetchAll() on a table object to use the SqlServer platform?

Chris

Chris KL
  • 4,882
  • 3
  • 27
  • 35

1 Answers1

0

OK, well I found there's a much easier way to do it, after much digging through the Zend Framework. Simply set up your database config like this:

'db' => array(
    'driver' => 'Pdo',
    'dsn' => 'dblib:host=xxx;dbname=xxx',
    'username' => 'xxxxxxxx',
    'password' => 'xxxxxxxx',
    'charset' => 'UTF-8',
    'platform' => 'SqlServer'
)

Now I'm getting different errors, will continue the story!

Chris KL
  • 4,882
  • 3
  • 27
  • 35
  • OK remaining error is due to the sqlsrv decorator not working perfectly with pdo:dblib. I submitted a pull request that fixes it: https://github.com/zendframework/zf2/pull/5092 – Chris KL Sep 09 '13 at 05:39