Stan:
On Thu, Jul 2, 2020 at 5:03 PM stan wrote:
> 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;
>
On Thu, 2 Jul 2020 11:03:37 -0400
stan wrote:
> my $sth = $dbh->prepare($stmt);
> my $rv = $sth->execute() or die $DBI::errstr;
that ``or die`` means: if the result of the ``execute`` is false
(which only happens on error), throw an exception (which, as you
noticed, terminates the process unless
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 ) {