According to the manual:

Zend_Db_Adapter_Abstract::insert (line 461)

Inserts a table row with specified data.

    * return: The number of affected rows.
    * access: public

int insert (mixed $table,  $bind)

    * mixed $table: The table to insert data into.
    * array $bind: Column-value pairs.


As the manual says, insert is not intended to return the generated key...


Please read:
http://framework.zend.com/manual/en/zend.db.html#zend.db.adapter.adapter-notes.pdo-oci

You should use:

Zend_Db_Adapter_Abstract::lastSequenceId (line 953)

Return the most recent value from the specified sequence in the database.

This is supported only on RDBMS brands that support sequences (e.g.
Oracle, PostgreSQL, DB2). Other RDBMS brands return null.

    * access: public

string lastSequenceId (string $sequenceName)

    * string $sequenceName





> I don't suppose there's anyway to use the RETURNING clause within
> Zend_Db's
> architecture without writing out the full statement myself and using
> parameter bindings?
>
> I'd expect Zend_Db_Adapter_Abstract::insert() would support something of
> this nature for Oracle databases. It's probably the only way to easily get
> back a primary key on tables that are setup to "mimic" auto_increment. On
> top of that, I'm having one hell of a time battling with our DBAs to gain
> access to even view the sequence to pop it. (not to mention we have a lot
> of
> auto-generated sequences that don't get created until first insert --
> please, don't ask. Even some of our current DBAs are baffled).
>
>
> ---
> Philip
> [EMAIL PROTECTED]
> http://www.gpcentre.net/
>


Reply via email to