List:MySQL and Perl« Previous MessageNext Message »
From:Gisbert W. Selke Date:March 28 2007 2:35pm
Subject:AW: Can I get PrintWarn to emit warnings from the server?
View as plain text  
> -----Ursprüngliche Nachricht-----
> Von: Baron Schwartz [mailto:baron@stripped]
> Gesendet: Mittwoch, 28. März 2007 03:26
> I'm trying to find a way to get Perl to print warnings from SQL 
> statements that I might need to log and investigate.  I'd 
> like this to 
> happen when I do a statement that truncates a data value, 
> converts a bad 
> date etc -- anything that normally results in the mysql command-line 
> client telling me there are warnings.
> 
> Is this possible?  PrintWarn currently doesn't seem to do 
> anything that 
> I can tell, but I'm not sure I'm doing it right:
> 
> my $dbh = DBI->connect($dsn, $user, $pass,
>     { PrintWarn => 1, RaiseError => 1, PrintError => 1 })
One way would be to 
  $dbh->prepare('show warnings');
and then execute() and fetch...().

\Gisbert 
Thread
Can I get PrintWarn to emit warnings from the server?Baron Schwartz28 Mar
AW: Can I get PrintWarn to emit warnings from the server?Gisbert W. Selke28 Mar
  • Re: AW: Can I get PrintWarn to emit warnings from the server?Baron Schwartz29 Mar