in reply to Mysql smallint out of range. How to fetch warning?
Just use the SHOW WARNINGS statement:
$dbh->do("CREATE TEMPORARY TABLE foo (bar SMALLINT)") $dbh->do("INSERT INTO foo (bar) VALUES (100000000)"); use Data::Dumper; print Dumper($dbh->selectall_arrayref("SHOW WARNINGS"));
Output:
$VAR1 = [ [ 'Warning', '1264', 'Out of range value adjusted for column \'bar\' at row 1' ] ];
-sam
|
---|
In Section
Seekers of Perl Wisdom