PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Ed Avis" <eda at waniasset dot com>
Subject: String truncated to 255 chars using DBD::Sybase with MSSQL
Date: May 18 2009 4:37PM

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 

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