| От | stan |
|---|---|
| Тема | Catching errors with Perl DBI |
| Дата | |
| Msg-id | 20200702150337.GA18581@panix.com обсуждение исходный текст |
| Ответы |
Re: Catching errors with Perl DBI
Re: Catching errors with Perl DBI |
| Список | pgsql-general |
How can I catch the errors generated whne I call an INSERT that violates a
constraint? I have coded like this:
my $sth = $dbh->prepare($stmt);
my $rv = $sth->execute() or die $DBI::errstr;
if ( $rv < 0 ) {
print $DBI::errstr;
}
But, if the INSERT violates a constraint, it never gets the the evaluation
of the $rv
Is this a setting for the DBI?
--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера