String truncated to 255 chars using DBD::Sybase with MSSQL

"Ed Avis" <[email protected]> Mon, 18 May 2009 17:37:24 +0100
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase
Message-ID <[email protected]>
I am using DBD::Sybase on Linux (Fedora 10) to connect to an MSSQL server (Microsoft SQL Server 2000).  The database allows varchar columns greater than 255 characters in length, but when querying from them the result is silently truncated.

    my $long_string = 'x' x 200;
    $dbh->do("select '$long_string' + '$long_string' as x into #t");

    my $sql = 'select len(x) from #t';
    my $got = $dbh->selectall_arrayref($sql)->[0]->[0];
    say $got;

    $sql = 'select x from #t';
    $got = $dbh->selectall_arrayref($sql)->[0]->[0];
    say length $got;

This prints '400' then '255' but I expected '400' and '400', or at least, some exception thrown when the string was too long.

Is there a way to access the whole string using DBD::Sybase?

-- 
Ed Avis <[email protected]>

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________