Skip to Content.
Sympa Menu

freetds - RE: DBLIB Unit Tests failing again

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: RE: DBLIB Unit Tests failing again
  • Date: Tue, 17 Sep 2002 10:46:39 -0400


> From: Thompson, Bill D (London) [mailto:ThompBil AT exchange.uk.ml.com]
> Sent: September 17, 2002 4:41 AM
>
> Somehow I KNEW I didn't want to open up this can of worms about date
> formats. I've had a sleepless night thinking about this

Oh, my. Sleep is important.

> I propose to more closely integrate my tds_datecrack() function (which
> decomposes a SYBDATETIME/4 into a "tm" like structure), with James'
> tds_strftime() function (which takes a slightly different "tm" like
> structure as input), so that the ouput of the first can be
> used as the input of the second. This will have a number of advantages:
>
> 1) I can encapsulate all "date cracking" code into the one function.
> Currently this is replicated in tds_convert_datetime() and
> tds_convert_datetime4().

Huge benefit. Maybe we should put all the date conversion code in a
separate module tds/datetime.c or something.

> 2) It will be easy to convert a SYBDATETIME to any format you like by
> calling tds_datecrack and then calling tds_strftime passing
> in the format of your choice.

Yup.

> I'll then put the code into the bcp code to do this instead of calling
> dbconvert() for datetime columns.
> I also thought I could pass in a slightly different date
> format depending on
> whether MSDBLIB is defined, to yield "2001-09-11..." instead
> of "Sep 11 2001..."

I'm with Frediano on this one, Bill. I don't see a need for two output date
formats, as long as you use ISO. BCP's job includes data exchange with
non-TDS systems, and I can't believe there's a data loading facility worthy
of the name that doesn't recognize ISO format.

Basically, for output purposes bcp.c will just convert the SYBDATETIME/4
into a tds_tm, then call tds_strftime() with the ISO formatting string.
Yes?

Sounds like you have a handle on it. And you won't have to touch the
dbprocess, making yesterday's debate moot.

Hope you rest easier tonight. :)

Regards,

--jkl








The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the
original message. Please note that for certain accounts we do not accept
orders and/or instructions by e-mail, and for those accounts we will not be
responsible for carrying out such orders and/or instructions. Kindly refrain
from sending orders or instructions by e-mail unless you have confirmed that
we accept such communications for your account. Please also note that to
satisfy regulatory requirements we review the outgoing and incoming e-mail
correspondence of staff members serving certain functions.






Archive powered by MHonArc 2.6.24.

Top of Page