Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-10-2008, 05:16 AM
Junior Member
 
Join Date: Oct 2008
Posts: 1
Default db->fetchAll

Hey all...

Trying to track down a bug with DB2/400 and fetchAll using the new db2 adapter included with the i5 version of Zend Core.

When attempting a db->fetchAll, I've been receiving the following error:

PHP Code:
[IBM][CLI Driver][AS] SQL5001N  "*N" does not have the authority to change the database manager configuration file.  SQLSTATE=42703 
With the help of a colleague we came to the realization that this was being caused by the query being constructed incorrectly.

PHP Code:
[1] => Zend_Db_Profiler_Query Object
             
(
            [
_query:protected] => SELECT "TABLE_NAME".* FROM "SCHEMA"."TABLE_NAME"
            
[_queryType:protected] => 32
            
[_startedMicrotime:protected] => 1223613422.19
            
[_endedMicrotime:protected] => 
            [
_boundParams:protected] => Array
                    (       )
            ) 
The SELECT above should actually read:
PHP Code:
SELECT FROM "SCHEMA"."TABLE_NAME" 
Knowing this, I started digging around to find where this query is being created, but being a n00b with ZFW, I quickly got lost in the code.

Anyone like to offer some direction?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-10-2008, 03:46 PM
Junior Member
 
Join Date: Jul 2008
Posts: 8
Default

Hi - not a db2 user myself, so I'm not aware of any bugs--but maybe I can help with the general question.

For debugging purposes, instead of calling fetchAll from an instance of Zend_Db_Adapter, you might want to call fetchAll from a Zend_Db_Statement_Db2 object instead. This removes a layer of indirection, and gives you more room to experiment (more query options) to figure out the source of your syntax error.

To construct a Zend_Db_Statement object, you pass a Zend_Db_Adapter instance and the sql query into the constructor; there's plenty on Statement in the reference guide to get you started.

Hope this helps!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:42 AM.