sql - text truncated using perl DBI insert -
the problem dbi
's insert
leaves long string truncated when inserting ms sql server. here codes:
my $insert = $dbh->prepare("insert my_table (field_1, field_2) values (?, ?)"); $insert->execute($value_1, $value_2);
where field_2
has data type of varchar(100)
, $value_2
text string of 90 characters spaces no other special characters.
after statement executed, no error raised, checked database , apparently actual inserted $value_2
truncated @ 80th character, in middle of regular english word (i.e. not special character).
i've tried alter data type of field_2
varchar(150)
, text
. i've used $dbh->quote($value_2)
in place of $value_2
. didn't help.
why happening? should do? thx!!
if using freetds bug identified in freetds mailing list. see freetds silently truncating text/varchar/etc fields 80 characters , http://lists.ibiblio.org/pipermail/freetds/2011q2/026943.html , http://lists.ibiblio.org/pipermail/freetds/2011q2/026925.html , http://lists.ibiblio.org/pipermail/freetds/2011q2/026944.html
Comments
Post a Comment