|
|
sybperl-l Archive
Up Prev Next
From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: Sybase Client & MS SQL7
Date: Jan 11 2001 5:37PM
kisss@tdsecurities.com writes:
>
>
> Hello,
>
> I have a problem with DateTime columns comning back from Sybperl 2.12, through
> Sybase Client 11.1.1 on Unix from MSSQL7 on NT.
> I have applied SP1 & SP2 to MSSQL7 and there are no more connection problems.
> The only problem at the moment is that datetime columns are screwed. I have
> digged deeper and found out that the problem is with:
> 1. dbconvert function of DB-lib
> or
> 2. dbfetch function of DB-lib
> because byte - date & time portion are simply switched - D1 D2 T1 T2 should be
> T1 T2 D1 D2. I hacked dblib.c and it works
>
> The only thing is that I do access Sybase server as well and I need extra if
> clause to determine when to switch byte and when not to.
The folks doing the FreeTDS project discovered this problem a while
back. This is a bug with MS-SQL which doesn't convert the data to
network order for datetime columns.
The FreeTDS library has a fix for this (I think). I don't really want
to put that sort of hack into DBlib.xs because it really is dependant
on the server that you connect to, as well as the libraries that you
use (i.e. if you use the FreeTDS libs you should be OK).
The alternative is to change the SQL to use convert(varchar, ) to return char strings instead of datetime values...
Michael
--
Michael Peppler - Data Migrations Inc. - mpeppler@peppler.org
http://www.mbay.net/~mpeppler - mpeppler@mbay.net
International Sybase User Group - http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com
|