use DBI;
my ($dbh, $data) = (undef, '');
$data .= chr(int rand 256) for 1..400;
eval{
$dbh = DBI->connect('DBI:ODBC:testdb', '', '')
or die $DBI::errstr;
my $sth = $dbh->prepare('insert into btest(id, data) values (?,?);') or die $dbh->errstr();
$sth->execute(1, $data) or die $dbh->errstr();
$dbh->disconnect();
};
print "Error : $@" if length $@;
####
testdb=# \d btest
Table "btest"
Attribute | Type | Modifier
-----------+---------+----------
id | integer | not null
data | text |
Index: btest_id_key
####
DBD::ODBC::st execute failed: Error while executing the query;
ERROR: Unterminated quoted string (SQL-S1000)
ERROR: Unterminated quoted string (SQL-S1000)(DBD: st_execute/SQLExecute err=-1
) at C:\Perl\dev\rdm\btest.pl line 12.