[freetds] insert varchar/text fields limited to max 80 characters

Piet De Jong piet at ahead-tech.net
Fri Feb 11 03:23:13 EST 2005


I have had the same problem, will check my code when I get to the office in
a few hours. 

> -----Original Message-----
> From: freetds-bounces at lists.ibiblio.org 
> [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Dirk Koopman
> Sent: 10 February 2005 07:31 PM
> To: freetds at lists.ibiblio.org
> Subject: [freetds] insert varchar/text fields limited to max 
> 80 characters
> 
> Environment:
> 
> MS-SQL 2003, TDS version 8.0, freetds 0.62.4, perl DBD::ODBC 
> and DBI (current CPAN versions).
> 
> doing something like:-
> 
> my $sth = $dbh->prepare("insert into SBOL [XDESC_C] 
> values(?)"); my $a = 
> "soooooooooooooooooooooooooooooooooooommmmmmmmmmmmmmmmmmmmmmmm
> mmmmmeeeeeeeeeeeeeeeeeeeeeeeeeeeeevvvvvvvvvvvvvvvvvvery-long-string";
> $sth->execute($a);
> 
> will only cause the first 80 characters of $a into SBOL.XDESC_C.
> 
> It does not seem to matter whether XDESC_C is declared as 
> varchar(1000) or text (we would prefer text). All varchar 
> fields with length > 80 and text fields have the data chopped 
> at 80 characters.
> 
> Tried all the obvious things like:-
> 
> $dbh = DBI->connect('dbi:ODBC:cpa', $cpauser, $passwd, 
> 		{
> 			RaiseError=>1, AutoCommit=>0,
>                		LongReadLen=>64*1024, LongTruncOk=>0,
> 			ChopBlanks=>1,
> 		} );
> 
> 
> The same code, but running direct to a MySQL or Pg database 
> (with different DBI dsn obviously) work just as expected. 
> 
> Any pointers?
> 
> Dirk
> 
> 
> 
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
> 



More information about the FreeTDS mailing list