[eluser]Unknown[/eluser]
I realize this is an old post, just figured I'd share what I've found on the topic.
If you're using the OCI driver, you can capture the most recent error with this:
Code:
oci_error( $this->db->stmd_id )
Which will return (in the event of a unique constraint error)
Code:
array(4) {
["code"]=>
int(1)
["message"]=>
string(74) "ORA-00001: unique constraint (DB.TABLE_UK1) violated"
["offset"]=>
int(0)
["sqltext"]=>
string(90) "INSERT INTO FAKETABLE (report_id, role_id, var_list) VALUES ('365','1','1090')"
}
I realize this could potentially be wrapped in the DB class somewhere but I'll leave that up to the reader to decide.