ZF-3546: Zend_Db_Adapter_Pdo_Oci lastInsertId

Issue Type: Bug Created: 2008-07-01T12:42:57.000+0000 Last Updated: 2008-11-13T14:10:19.000+0000 Status: Resolved Fix version(s): - 1.7.0 (17/Nov/08)

Reporter: Martin Hujer (mhujer) Assignee: Mickael Perraud (mikaelkael) Tags: - Zend_Db

Related issues: Attachments:


Oracle DB doesn't support auto increment, so the lastInsertId doesn't work.

I suggest this change, because Zend_Db_Table also uses lastInsertId() and when it throws an exception, that Oracle doesn't support it, it breaks an application.

It is already written in the comment to this method: {quote}Oracle does not support IDENTITY columns, so if the sequence is not specified, this method returns null.{quote}

<pre class="highlight">
Index: I:/xampp/php/PEAR/Zend15/library/Zend/Db/Adapter/Pdo/Oci.php
--- I:/xampp/php/PEAR/Zend15/library/Zend/Db/Adapter/Pdo/Oci.php    (revision 9855)
+++ I:/xampp/php/PEAR/Zend15/library/Zend/Db/Adapter/Pdo/Oci.php    (working copy)
@@ -292,7 +292,7 @@
             $sequenceName .= $this->foldCase('_seq');
             return $this->lastSequenceId($sequenceName);
-        return $this->_connection->lastInsertId($tableName);
+        return;


Posted by Martin Hujer (mhujer) on 2008-07-24T12:05:54.000+0000

it also affects 1.6.0RC1

Posted by Martin Hujer (mhujer) on 2008-08-12T23:46:06.000+0000

It also affects 1.6.0RC2

Posted by Martin Hujer (mhujer) on 2008-08-29T12:27:31.000+0000

It also affects 1.6.0RC3

Posted by Martin Hujer (mhujer) on 2008-09-07T02:01:37.000+0000

It also affects 1.6.0.

Posted by Martin Hujer (mhujer) on 2008-10-13T12:40:58.000+0000

It also affects 1.6.1.

Posted by Mickael Perraud (mikaelkael) on 2008-10-13T13:25:34.000+0000

Fixed in SVN11942

Posted by Wil Sinclair (wil) on 2008-11-13T14:10:18.000+0000

Changing issues in preparation for the 1.7.0 release.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.