Question:
How can I catch or supress a unique constraint violated error using ADOdb?
Error:
[2] ociexecute() [function.ociexecute]: OCIStmtExecute: ORA-00001: unique constraint violated (@line 853 in file /adodb/drivers/adodb-oci8.inc.php).
Summary:
Since I know that there is already a record within my PEOPLE table with identical values, when I try the following - the statements in the catch block are not ran since the script dies within the adodb-oci8.inc.php page.
$sql = "INSERT INTO SCHEMA.PEOPLE (name, age)
VALUES (:NAME, :AGE)";
$args = array(
'NAME' => 'TODD',
'AGE' => 30
);
$DAO = NewADOConnection("oci8://todd:password@tns/");
try {
$DAO->Execute($sql, $args);
} catch (exception $e) {
var_dump($e);
adodb_backtrace($e->gettrace());
}
Plus, I have included the required files:
include("../adodb-exceptions.inc.php");
include("../adodb.inc.php");
Any ideas, suggestions or examples on how I can catch or supress a unique constraint violated error using ADOdb is greatly appreciated!
Thanks you!