Skip to content
This repository has been archived by the owner on May 16, 2018. It is now read-only.

CLONE - DB2 on i5 fails because of table and column names quoting #29

Open
zfbot opened this issue Apr 5, 2013 · 3 comments
Open

CLONE - DB2 on i5 fails because of table and column names quoting #29

zfbot opened this issue Apr 5, 2013 · 3 comments

Comments

@zfbot
Copy link

zfbot commented Apr 5, 2013

Jira Information

Original Issue:ZF-12458
Issue Type:Bug
Reporter:Stephen McMahon
Created:10/30/12
Assignee:Ralph Schindler
Components:Zend_Db_Adapter_Db2

Description

The following script was used:

echo 'Version:- '.Zend_Version::VERSION.'<br /><br />';

$stmt = $db->select()->from('psvf.STOCK')->where( 'VIN = ?' , 'ZZZ');

var_dump($stmt->__toString());

echo '<br />';

$test = $db->fetchAll($stmt,2);

It fails with the following result:

Version:- 1.11.10

string(73) "SELECT "HYOLABR".* FROM "psvf"."HYOLABR" AS "HYOLABR" WHERE (VIN = 'ZZZ')" 

Fatal error: Uncaught exception 'Zend_Db_Statement_Db2_Exception' with message 'HYOLABR in "psvf" type *FILE not found. SQLCODE=-204' in /usr/local/zendsvr/share/ZendFramework/library/Zend/Db/Statement/Db2.php:69 Stack trace: #0 /usr/local/zendsvr/share/ZendFramework/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Db2->_prepare('SELECT "HYOLABR...') #1 /usr/local/zendsvr/share/ZendFramework/library/Zend/Db/Adapter/Db2.php(238): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Db2), 'SELECT "HYOLABR...') #2 /usr/local/zendsvr/share/ZendFramework/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Db2->prepare('SELECT "HYOLABR...') #3 /usr/local/zendsvr/share/ZendFramework/library/Zend/Db/Adapter/Abstract.php(736): Zend_Db_Adapter_Abstract->query(Object(Zend_Db_Select), 2) #4 /www/zendsvr/htdocs/PSIwarranty/zendtest.php(24): Zend_Db_Adapter_Abstract->fetchAll(Object(Zend_Db_Select), 2) #5 {main} thrown in /usr/local/zendsvr/share/ZendFramework/library/Zend/Db/Statement/Db2.php on line 69

The following script works OK:

$stmt = "select * from psvf.STOCK where VIN = 'ZZZ'";

$prepare = $db->query($stmt);

$result = $db->fetchAll($stmt);
@zfbot
Copy link
Author

zfbot commented Apr 5, 2013

(Originally posted by: Stephen McMahon on 10/30/12)

This error appears to be related to ZF-3011 but not quite the same.
Happens with ZendServer CE running on iSeries

@zfbot
Copy link
Author

zfbot commented Apr 5, 2013

(Originally posted by: Stephen McMahon on 10/30/12)

Setting Zend_Db::AUTO_QUOTE_IDENTIFIERS => false fixes issue, seems likely that DB2 doesn't like aggressive quoting of tables. Maybe extend the DB2 class to overwrite to false.

@zfbot
Copy link
Author

zfbot commented Apr 5, 2013

This issue was ported from the ZF2 Jira Issue Tracker at
http://framework.zend.com/issues/browse/ZF-12458

Known GitHub users mentioned in the original message or comment:

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

No branches or pull requests

1 participant