Il faut interroger les variables SQLERRM et SQLCODE je crois.