|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-09-18 07:29 UTC] michael dot virnstein at brodos dot de
Description:
------------
When the database error NO_DATA_FOUND is raised, oci_error returns false instead of the error in oci8 1.3.5.
Reproduce code:
---------------
<?php
$conn = oci_connect('user', 'pass', 'db');
$stmt = oci_parse($conn, 'begin raise NO_DATA_FOUND; end;');
oci_execute($stmt, OCI_DEFAULT);
var_dump(oci_error($stmt));
?>
Expected result:
----------------
oci_error returning the oracle error
Actual result:
--------------
oci_error returns false (no error)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 22 22:00:01 2025 UTC |
NO_DATA_FOUND is generally not an error: null data sets are still valid sets. In PHP it will raise a warning. See php_oci_error() in oci8.c. If you want to indicate an application failure when there is no data, catch the NO_DATA_FOUND exception in PL/SQL and raise your own exception: declare my_failure exception; begin raise NO_DATA_FOUND; exception when NO_DATA_FOUND then raise my_failure; end