update query with Freetds

Roger Burton West roger at firedrake.org
Wed Sep 6 07:20:41 EDT 2000

On or about Wed, Sep 06, 2000 at 07:10:42AM +0000, L. DAVID typed:
>I'm a newbie into this community, and currently working
>on a project trying to use freetds 4.2 with PHP 3 running
>on Solaris with Apahce, to send some queries to a MS SQL 7 database
>running on NT.
>All the select like requests are running well, but 
>Apache seems to trap when we are trying an update
>request on a table.
>Is this a bug, or is there something special to configure
>when building freetds ?

I'm also a newbie here... but this may be something that bit me,
which I've semi-solved. (There are archive messages that seem
to be related, though it's not entirely clear to me yet; and alas,
my employers disapprove of my spending the _entire_ day reading
about tools rather than working with them.)

Are the update queries longer than 512 characters, while the
selects are shorter? MS-SQL 7 seems to have problems with queries
sent in more than about two packets, and closes the data stream -
and FreeTDS hangs waiting for a response.

Try extending the packet length in write.c, where it's set to
512 at the moment - might also be worth raising BUFSIZ to match.

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?


Roger Burton West                                    roger at firedrake.org
                      ACTING IN A PRIVATE CAPACITY
Senior Internet Developer                         Torrington Interactive

More information about the FreeTDS mailing list