update query with Freetds

Jai Cornes tygger at netizen.com.au
Wed Sep 6 09:32:52 EDT 2000

On Wed, Sep 06, 2000 at 12:20:41PM +0100, Roger Burton West wrote:
> Something I haven't seen discussed here is spurious NULs - I'm
> using DBD::Sybase on top of FreeTDS to talk to MS-SQL7, and
> most of the fields returned by SELECTs have trailing NULs.
> Naturally this wouldn't be a problem with C, but Perl quite
> happily retains and forwards the NULs, thus confusing the web
> browser... has anyone else seen this, and is there a
> recommended fix?
*nodnod*  Seen it, sweated over it, stuck it on a TODO list for my 
Copious Free Time (tm) . Our theory is that the MS SQL server uses \0,
or NULs to mark the end of a string in a fixed length field. 
We fixed it last week by having the Perl code trap them (they came out 
as ^@) with a regex, and delete them. This worked, but I'd like to hack 
the freetds stuff to deal with it "properly", since I can't see it as being
desirable. This was in code we wrote originally with the Sybase proprietary 
client  libraries, which dealt "properly" with these NULs. So if someone
more experienced than myself with FreeTDS would care to point me in the right 
direction, I'm happy to hack on it, because the freetds stuff is a Good Thing
(tm) And while we're on the DBD::Sybase topic, is it true there's now a 


Jai Cornes
Systems Developer.
Netizen Pty Ltd.
tygger at netizen.com.au

More information about the FreeTDS mailing list