Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Capturing Errors

0 views
Skip to first unread message

ExecMan

unread,
Jan 26, 2012, 9:35:30 AM1/26/12
to

I thought I'd ask this in the Oracle group. Does Oracle have a way of
returning exceptions thrown to STDERR for a PHP script to capture and
work with?

Short of returning the error in a cursor or as a function value, is
there any way to capture the error that Oracle may throw? Our app
team is asking this.

ddf

unread,
Jan 26, 2012, 11:19:34 AM1/26/12
to
It depends; you could read here:

http://oratips-ddf.blogspot.com/2008/09/to-err-is-human.html

and see if this answers your question.


David Fitzjarrell

ExecMan

unread,
Jan 26, 2012, 11:51:31 AM1/26/12
to
Not quiet. I'm looking to see if there is something like OCI_ERROR
where I can capture this from the application end......


Mladen Gogala

unread,
Jan 26, 2012, 12:22:02 PM1/26/12
to
It depends on the framework you're using to work with Oracle. If you're
using the native OCI8 framework, which is procedural in nature, you have
to throw exceptions yourself, for every error that occurs.
If, on the other hand, you are using ADOdb, it has facilities to throw
exceptions which can be caught like this:
try {
$db->Connect($DSN['database'], $DSN['username'], $DSN['password']);
if (!empty($AFILE)) {
$rs = $db->Execute($AFILE);
}
$rs = $db->Execute($FILE, array('TBLSPC' => $TBLSPC));
csr2html($rs, ' ');
$db->close();
}
catch(Exception $e) {
die($e->getMessage());
}

That will catch any possible error during the connection phase, as well as
the errors in SQL execution. ADOdb can be downloaded from here:

http://adodb.sourceforge.net/

--
http://mgogala.freehostia.com

Mladen Gogala

unread,
Jan 26, 2012, 4:16:34 PM1/26/12
to
On Thu, 26 Jan 2012 08:51:31 -0800, ExecMan wrote:

> Not quiet. I'm looking to see if there is something like OCI_ERROR
> where I can capture this from the application end......

Something like this?
http://us3.php.net/manual/en/function.oci-error.php



--
http://mgogala.freehostia.com
0 new messages