|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-03-12 12:57 UTC] christopher dot jones at oracle dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Description: ------------ I'm using OCI8 1.1.1, and I think that ocierror function must keep the last ocurred error for more than one call to ocierror. I have made some tests with SQLite and MySQL, and this feature that I request is implemented by these database modules. Reproduce code: --------------- <?php $conn = ocilogon('user', 'pass', 'db'); if (!$conn) die('Not possible to connect to database'); // There is a constraint here $query = 'DELETE FROM SGR_ATIVIDADE WHERE CDATIVIDADE=2'; $stmt = ociparse($conn, $query); $ret = ociexecute($stmt); if ($ret) echo 'Atividade deleted.'; else { $cnt = 10; while ($cnt-- > 0) { $aError = ocierror($stmt); echo (10-$cnt) .' -> '.$aError['message'] ."\n"; } } ocilogoff($conn); ?> Expected result: ---------------- 1 -> ORA-02292: integrity constraint (SISCORP.ATV_GRPPES) violated - child record found 2 -> ORA-02292: integrity constraint (SISCORP.ATV_GRPPES) violated - child record found 3 -> ORA-02292: integrity constraint (SISCORP.ATV_GRPPES) violated - child record found 4 -> ORA-02292: integrity constraint (SISCORP.ATV_GRPPES) violated - child record found 5 -> ORA-02292: integrity constraint (SISCORP.ATV_GRPPES) violated - child record found 6 -> ORA-02292: integrity constraint (SISCORP.ATV_GRPPES) violated - child record found 7 -> ORA-02292: integrity constraint (SISCORP.ATV_GRPPES) violated - child record found 8 -> ORA-02292: integrity constraint (SISCORP.ATV_GRPPES) violated - child record found 9 -> ORA-02292: integrity constraint (SISCORP.ATV_GRPPES) violated - child record found 10 -> ORA-02292: integrity constraint (SISCORP.ATV_GRPPES) violated - child record found Actual result: -------------- 1 -> ORA-02292: integrity constraint (SISCORP.ATV_GRPPES) violated - child record found 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8 -> 9 -> 10 ->