oci_error
Returns the last error found
&reftitle.description;
arrayoci_error
resourceresource
Returns the last error found.
The function should be called immediately after an error occurs.
Errors are cleared by a successful statement.
&reftitle.parameters;
resource
For most errors, resource is the
resource handle that was passed to the failing function call.
For connection errors with oci_connect,
oci_new_connect or
oci_pconnect do not pass resource.
&reftitle.returnvalues;
If no error is found, oci_error returns
&false;. Otherwise, oci_error returns the
error information as an associative array.
oci_error Array Description
Array key
Type
&Description;
code
integer
The Oracle error number.
message
string
The Oracle error text.
offset
integer
The byte position of an error in the SQL statement. If there
was no statement, this is 0
sqltext
string
The SQL statement text. If there was no statement, this is
an empty string.
&reftitle.changelog;
&Version;
&Description;
PHP 4.3
The offset and sqltext
entries were added.
&reftitle.examples;
Displaying the Oracle error message after a connection error
]]>
Displaying the Oracle error message after a parsing error
]]>
Displaying the Oracle error message, the problematic statement,
and the position of the problem of an execution error
\n";
print htmlentities($e['sqltext']);
printf("\n%".($e['offset']+1)."s", "^");
print "\n\n";
}
?>
]]>
&reftitle.notes;
In PHP versions before 5.0.0 you must
use ocierror instead. &oci.name.compat.note;