in reply to Re^4: Can I get the actual error for DBI->execute() ?
in thread Can I get the actual error for DBI->execute() ?
I prefer to do it that way instead of checking for errors after each DB operation. In your code above, prepare can also throw an error. $dbHandle will be undef if there is an error and you should check for that if you don't set RaiseError.
Note that execute sometimes returns a numerical value that has meaning, like perhaps the number of rows updated. execute behaves differently say for a SELECT statement where no information is provided. So a simple check of $result to detect an error won't work like it does for $dbHandle.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: Can I get the actual error for DBI->execute() ?
by Danny (Chaplain) on Jun 23, 2024 at 02:35 UTC | |
by Marshall (Canon) on Jun 24, 2024 at 13:16 UTC | |
by Danny (Chaplain) on Jun 24, 2024 at 14:40 UTC | |
by Marshall (Canon) on Jun 24, 2024 at 18:05 UTC |