tripat
asked on
Mysql errors
I am using mysql as database with dbi/dbd.
If some error occurs while inserting data in mysql, how to display it or trap it in perl program?
If some error occurs while inserting data in mysql, how to display it or trap it in perl program?
ASKER
Thanks for your suggestions.
Pl tell me exact location of
'perldoc DBI'.
Also, I am not passing any parameters in execute statement.
Do I need to download any additional library for it or just paste this code in my program.
thanks agian
Pl tell me exact location of
'perldoc DBI'.
Also, I am not passing any parameters in execute statement.
Do I need to download any additional library for it or just paste this code in my program.
thanks agian
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
$sth=$dbh->prepare("SQL code ...") || errorExit "$DBH::errstr";
$sth->execute($arg1,$arg2)
where errorExit() is a subroutine that gets the current error message from the failed operation and outputs a line to the error_log identifying the error situation. The user will see a "failed" message and is requested to retry the operation.
Look at the 'perldoc DBI ' pages.
Hope this helps
Tobias