Discussion:
[freetds] DBD::Sybase MSSQL VARBINARY 255 byte limit
Debbie
2006-09-03 22:14:48 UTC
Permalink
Hello,

I am using Perl DBD::Sybase on Linux, attempting to fetch VARBINARY
columns from an MSSQL database. When I fetch columns that are longer
than 255 bytes however, it gets truncated.

PHP on Linux using the mssql_*() functions and FreeTDS doesn't seem to
have this problem.

Does anyone have a solution? e.g.

- Can I configure DBD::Sybase to support VARBINARY columns >255 bytes?
- Is there a Perl module other than DBD::Sybase I can use to talk to
FreeTDS/MSSQL?
- Or do I have to move my Perl program onto the Windows machine
if I need >255 byte VARBINARY support?
jklowden
2006-09-03 22:38:39 UTC
Permalink
Post by Debbie
Hello,
I am using Perl DBD::Sybase on Linux, attempting to fetch VARBINARY
columns from an MSSQL database. When I fetch columns that are longer
than 255 bytes however, it gets truncated.
Sounds like you're using TDS 4.2. Make sure you're using TDS version 7.0
or 8.0 with your server. Cf. http://www.freetds.org/userguide/freetdsconf.htm#FREETDSCONFFORMAT.

HTH.

--jkl
Debbie
2006-09-03 23:25:23 UTC
Permalink
Post by jklowden
Post by Debbie
I am using Perl DBD::Sybase on Linux, attempting to fetch VARBINARY
columns from an MSSQL database. When I fetch columns that are longer
than 255 bytes however, it gets truncated.
Sounds like you're using TDS 4.2. Make sure you're using TDS version 7.0
or 8.0 with your server. Cf. http://www.freetds.org/userguide/freetdsconf.htm#FREETDSCONFFORMAT.
Ahh, thank you!! I was using

DBI->connect('dbi:Sybase:host=127.0.0.1;port=1433')

I switched to using:

DBI->connect('dbi:Sybase:server=MSSQL')

with this ~/etc/freetds.conf:

[MSSQL]
host = 127.0.0.1
port = 1433
tds version = 8.0

and now it's able to read VARBINARY columns without truncating them to
255 characters. Thanks again.

Loading...