[freetds] DBD::ODBC::st fetchrow_hashref failed: [unixODBC][FreeTDS][SQL Server]Data truncated (SQL-01004)

James K. Lowden jklowden at freetds.org
Mon May 18 18:09:02 EDT 2009


Buurman, H.A. (Herbert) wrote:
> 
> my $ExampleQuery = $dbh->prepare("SELECT Identifier FROM Table WHERE
> Identifier = ?");
> my $Record_ref;
> my $Identifiers_ref = $dbh->selectcol_arrayref("SELECT TOP 10 Identifier
> 
> FROM Table WHERE SomeCondition > 0");
> foreach (@{$Identifiers_ref}) {
>     $ExampleQuery->execute($_);
>     if ($Record_ref = $ExampleQuery->fetchrow_hashref()) {
>         foreach (keys %{$Record_ref}) { print("$_ => $Record_ref->{$_},
>         "); } print("\n");
>     } else {
>         print("Error fetching data for item [$_]\n");
>     }
>     $ExampleQuery->finish();
> }

Is this a Sybase or Microsoft server?  DBI Placeholders are not expected
to work with TDS 7.0+.  

--jkl



More information about the FreeTDS mailing list