Out of curiosity, if you are using MySQL, why not use the autoincrement
feature of the RDBM system?
Or, is your concern about supporting sequences if you choose to switch
vendors mid-stream?
-ralph
scs wrote:
As I was searching for my problem below, I read that the sequences are
only supported in some of the rdbms such as oracle and pgsql.
I am disappointed since I was expecting an implementation like PEAR
MDB2 and other db abstraction layers.
As a result, if we are using MySQL then we will not be able to use
sequences. Or we have to use PgSQL, Oracle or something else.
Am I right? :s
scs
On Sun, Oct 25, 2009 at 1:23 AM, scs <[email protected]> wrote:
Hi,
Is the model class code below enough to use sequence for this model/table?
Is there something extra that I shall do for getting the primary key
from sequence?
class Default_Model_DbTable_Test extends Zend_Db_Table_Abstract
{
protected $_name = 'table_name';
protected $_sequence = '_seq_table_name';
protected $_primary = 'id';
protected $_pk = 'id';
}
If not, this code does not get a new id from defined sequence?
Any correction or idea?
Thanks
scs