I am trying to adapt a Zend Skeleton application to use an ODBC connection. I can set up a PDO connection outside of Zend (same table, server, everything) as follows:
new PDO('odbc:DRIVER={iSeries Access ODBC Driver};SYSTEM=<serverName>;HOSTNAME=<serverName>;DATABASE=<databaseName>;', '<userName>', '<password>'); $r = $this->conn->query('SELECT * FROM <databaseName>.<tableName>');
But when I add this information to the global.php file:
'db' => array( 'driver' => 'Pdo', 'dsn' => 'odbc:DRIVER={iSeries Access ODBC Driver};SYSTEM=<serverName>;HOSTNAME=<serverName>;DATABASE=<databaseName>;', ),
And in local.php:
return array( 'db' => array( 'username' => '<userName>', 'password' => '<password>', ), );
I get an error that the table was not found:
SQLSTATE[42S02]: Base table or view not found: 0 [IBM][iSeries Access ODBC Driver][DB2 UDB]SQL0204 - <tableName> in <userName - yes you read that right> type *FILE not found.
I believe this is because my <databaseName>.<tableName> ends with double quotes when the request passes through Zend. I canβt explain why Zend is looking for my table under the username. However, I cannot get the PDO to recognize the table without a prefix, even though I tried to declare my database every time I initialized the PDO. I can think.
Is there a way for PDO to actually pick up the database name, so I don't need a prefix? Or is there a way to tell Zend to use a prefix (not concentrated in quotation marks with the table name)?
I apologize if I use the wrong language here. I get a little lost between Schema, Database, Library, File, Table, etc. when I go between SQL and iSeries.
I really appreciate any help you can offer, Zend is new to me.