0
votes

I'm using Zend Framework version 1.7.8.

I am trying to create a class that extends from Zend_Db_Table_Abstract:

class My_Model_Table extends Zend_Db_Table_Abstract {    
    public function __construct($tableName) {
        parent::__construct(array('name' => $tableName, 'primary' => 'dummy', 'db' => Zend_Registry::get('dbAdapter')));
    }
}

However, when I try to fetch from this table:

$table = new My_Model_Table('dual');
Zend_Debug::dump($table->fetchAll());

I am getting this exception:

Primary key column(s) (dummy) are not columns in this table (DUMMY) 

For those of you not familiar with Oracle, the DUAL table is a standard Oracle table which has only one column: DUMMY. From what I can see in the error message, ZF is trying to fetch from the "DUMMY" table which doesn't exist. Am I right? What am I doing wrong?

Thanks!

2

2 Answers

0
votes

Have you tried:

Class VCCE_Model_Table extends Zend_Db_Table_Abstract {
   protected $_name = 'DUAL';
 }

$table = new VCCE_Model_Table();
Zend_Debug::dump($table->fetchAll());

Note: in your example you use two different names for your table VCCE_Model_Table and My_Model_Table.

0
votes

Did you check the configuration settings for dbAdapter?