dbTalk Databases Forums  

Capturing Errors

comp.databases.oracle.server comp.databases.oracle.server


Discuss Capturing Errors in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ExecMan
 
Posts: n/a

Default Capturing Errors - 01-26-2012 , 08:35 AM






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.

Reply With Quote
  #2  
Old   
ddf
 
Posts: n/a

Default Re: Capturing Errors - 01-26-2012 , 10:19 AM






On Jan 26, 7:35*am, ExecMan <artme... (AT) yahoo (DOT) com> wrote:
Quote:
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.
It depends; you could read here:

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

and see if this answers your question.


David Fitzjarrell

Reply With Quote
  #3  
Old   
ExecMan
 
Posts: n/a

Default Re: Capturing Errors - 01-26-2012 , 10:51 AM



On Jan 26, 10:19*am, ddf <orat... (AT) msn (DOT) com> wrote:
Quote:
On Jan 26, 7:35*am, ExecMan <artme... (AT) yahoo (DOT) com> wrote:

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.

It depends; you could read here:

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

and see if this answers your question.

David Fitzjarrell

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

Reply With Quote
  #4  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: Capturing Errors - 01-26-2012 , 11:22 AM



On Thu, 26 Jan 2012 06:35:30 -0800, ExecMan wrote:

Quote:
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.
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

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.