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