| Data-ObjectDriver documentation | Contained in the Data-ObjectDriver distribution. |
Data::ObjectDriver::Errors - container class for common database error codes
eval { $driver->insert($obj); };
if ($@ && $driver->last_error() == Data::ObjectDriver::Errors->UNIQUE_CONSTRAINT) {
...
Data::ObjectDriver::Errors is a container class for error codes resulting
from DBI database operations. Database drivers can map particular database
servers' DBI errors to these constants with their map_error_code methods.
UNIQUE_CONSTRAINTThe application issued an insert or update that would violate the uniqueness constraint on a particular column, such as attempting to save a duplicate value to an indexed key field.
Data::ObjectDriver::Driver::DBD::map_error_code
Data::ObjectDriver is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
Except where otherwise noted, Data::ObjectDriver is Copyright 2005-2006 Six Apart, cpan@sixapart.com. All rights reserved.
| Data-ObjectDriver documentation | Contained in the Data-ObjectDriver distribution. |
# $Id$ package Data::ObjectDriver::Errors; use strict; use warnings; use constant UNIQUE_CONSTRAINT => 1; 1; __END__