Skip to Content.
Sympa Menu

freetds - Re: [freetds] Problem with datetime from a MS SQL Server

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Brian Bruns <camber AT ais.org>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] Problem with datetime from a MS SQL Server
  • Date: Sun, 9 Feb 2003 23:00:03 -0500 (EST)

I had been thinking about this since I put in the --enable-msdblib option
in. We could make the dbdaterec structure hold the values for both sybase
and msdblib names and then dbdatecrack can fill in both values, great for
source compatibility with both and if we put the sybase stuff first in the
structure, binary compat should be no problem (assuming we are shooting
for sybase binary compatibility, which is really the only option on *nix
platforms). Anyway, point is we could remove the --enable-msdblib option
entirely.

Brian

On Sun, 9 Feb 2003, Frank M. Kromann wrote:

> Hi James,
>
> Thanks for the answer. I did not use --enable-msdblib. I'll test that and
> if it works I'll change the PHP documentation on how to build FreeTDS.
>
> Is there a way to check how it is compiled so I can make a fix so it will
> work with or wighout this option ?
>
> - Frank
>
> > On Sun, 09 Feb 2003 14:54:34 -0800, "Frank M. Kromann"
> > <frank AT kromann.info> wrote:
> > >
> > > When fetching a datetime column I get two different results:
> > >
> > > using dbconvert() I get 'Mar 17 2001 12:00AM'
> > >
> > > using dbdatecrack() I get '2001-02-17 00:00:00'
> > >
> > > Notice the difference in the Month. According to MS documentation the
> > > month should be 1-12 and this works on Windows using the
> ntwdblib.lib.
> >
> > Hi Frank,
> >
> > Sybase says 0-11:
> >
> > typedef struct dbdaterec
> > {
> > long dateyear; /* 1900 to the future */
> > long datemonth; /* 0 - 11 */
> > long datedmonth; /* 1 - 31 */
> > long datedyear; /* 1 - 366 */
> > long datedweek; /* 0 - 6 */
> > long datehour; /* 0 - 23 */
> > long dateminute; /* 0 - 59 */
> > long datesecond; /* 0 - 59 */
> > long datemsecond; /* 0 - 997 */
> > long datetzone; /* 0 - 127 */
> >
> > Our db-lib should change, according to whether or not --enable-msdblib
> was
> > configured. If it is, we should produce 1-12, if not, 0-11. That
> would
> > be the only appropriate answer for FreeTDS, if --enable-msdblib is
> going
> > to do what it's supposed to do.
> >
> > What you should do is less clear to me. If your extension relies on
> our
> > configuration, that would preclude use of some combinations of servers.
>
> > If OTOH you write to Sybase's spec, I'll do what I can to make sure you
> > don't get less functionality than you would if you --enable-msdblib.
> >
> > Thanks for the pr.
> >
> > --jkl
> >
> > _______________________________________________
> > FreeTDS mailing list
> > FreeTDS AT lists.ibiblio.org
> > http://lists.ibiblio.org/mailman/listinfo/freetds
> >
>
>
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>





Archive powered by MHonArc 2.6.24.

Top of Page