The print string you show is:

    "prepare: $insert_sql: $DBI::errstr"

but your error message is

    Unable to execute query: DBI::db=HASH(0x8647df0)->errstr

I think your problem is with a print line like:

    print "Unable to execute query: $dbh->errstr"

and Perl is interpolating $dbh, but not the full method call
$dbh->errstr.
You want instead:

    print "Unable to execute query: ", $dbh->errstr

or

    print "Unable to execute query: @{[ $dbh->errstr ]}"

You will probably have better luck with your Perl questions on Usenet
newsgroup comp.lang.perl.misc, or on the Perl Monks site
www.perlmonks.org.

> -----Original Message-----
> From: sam [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, March 10, 2005 7:56 AM
> To: Mysql
> Subject: Perl DBI does not print error.
> 
> Hi,
> 
> The perl DBI does not prints error message:
> $sth = $dbh->prepare($insert_sql)
>            || print ERRFILE_OUT "prepare: $insert_sql: $DBI::errstr";
> 
> The out of this error only does not print why the error was occurred.
> eg.
> Unable to execute query: DBI::db=HASH(0x8647df0)->errstr:
> 
> Dan anyone please tell me how to prints how a description of 
> the error 
> from DBI when sql executed failed?
> 
> Thanks
> Sam
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to