[freetds] String or binary data would be truncated

Nguyen, Thi X. tnguyen at powertv.com
Tue Sep 19 20:41:30 EDT 2006

Hello all,

I am using DBD-ODBC 1.13, unixODBC 2.2.11, FreeTDS 0.64, MS SQL 2005,
and Perl
This is part of the Perl script:

	    # Assign this task
	    # End the Get Queue task in the Build Log table
	    $hDatabase->do("UPDATE BuildLog SET StepEnded = 1, Success =
1, " 
	                 . "BuildStepDuration = DATEDIFF (s,
	                 . "WHERE BuildType = '$bld{BuildType}' AND
BuildCount = '$bld{BuildCount}' "
	                 . "AND RequestDate = '$bld{RequestDate}' AND
BuildStep = 'Get Queue' ");
	    # Add new Get task in the Build Log table
	    print "Assigning new task: Get Code,$bld{BuildType},
	    $hStatement=$hDatabase->prepare("INSERT INTO BuildLog
(BuildType, BuildCount, RequestDate, BuildStep, "
	                 . "MachineAssigned, BuildStepBegin, StepEnded,
Success ) "
	                 . "VALUES ('$bld{BuildType}',
'$bld{BuildCount}', '$bld{RequestDate}', 'Get Code', " 
	                 . "'$bldMach', CURRENT_TIMESTAMP, 0, 0)");
		or localDie "Couldn't execute statement: " .

>From a Linux box, I am able to do the $hDatabase->do("UPDATE ..... 
but the 	$hStatement->execute() gives me error
DBD::ODBC::st execute failed: [unixODBC][FreeTDS][SQL Server] String or
binary data would be truncated. (SQL-22001)

and the script quits.

Please give me a pointer to go further. I spent so much the getting the
above combination (DBD-ODBC 1.13, unixODBC 2.2.11, FreeTDS 0.64, MS SQL
2005, and Perl) to work.


Thi Nguyen

     - - - - - Appended by Scientific Atlanta, a Cisco company - - - - -  This e-mail and any attachments may contain information which is confidential, proprietary, privileged or otherwise protected by law. The information is solely intended for the named addressee (or a person responsible for delivering it to the addressee). If you are not the intended recipient of this message, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete it from your computer.

More information about the FreeTDS mailing list