Skip to Content.
Sympa Menu

freetds - Re: Unable to retrieve data Linux<->MSSQL 7

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Eric Deutsch <edeutsch AT systemsbiology.org>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Unable to retrieve data Linux<->MSSQL 7
  • Date: Fri, 11 Jan 2002 11:24:41 -0800 (PST)



If you always want all of your dates to be in ISO format, you can do what
I do:

edit src/tds/convert.c

change all the format strings in the strftime() calls from
"%b %d %Y %I:%M%p"
to:
"%Y-%m-%d %H:%M:%S"
and recompile freetds.

This is now your default datetime format. You can always override with
the SQL syntax shown below from the previous post.

There has been talk on the list of making the default datetime format
string more easily selectable either at build time or run time, but there
hasn't yet been a consensus on what the "right" way to do it is, or anyone
to just implement one of the options.

Eric



On Fri, 11 Jan 2002, Lowden, James K wrote:

> > From: Björn Lantz [mailto:bjorn.lantz AT easyt.com]
> > Sent: January 11, 2002 10:40 AM
> > Subject: [freetds] Re: Unable to retrieve data Linux<->MSSQL 7
> >
> > I found out what the problem was. When I check the result column names
> > they are all in capital letters! no wonder my strcmp() never found the
> > right column, so I am now able to retrieve data from my test
> > program in C.
> >
> > Right now I am having trouble with the date format. I want it in a ISO
> > format (YYYY-MM-DD HH:MM:SS), but I keep getting it in
> > american(?) format
> > (Mar 28 2002 12:00AM) when I bind the column to SQL_C_CHAR type.
>
> Björn,
>
> The driver is free to choose how to bind a datetime to a string; what you're
> seeing is what Sybase's db-lib does. To get the format you want, use
> CONVERT(varchar(20), COLUMN_NAME, 120) in your SELECT statement.
>
> > Are there any options in freetds to set the locale ?
>
> There's no locale stuff in FreeTDS yet. You can, however, set the client
> character set in freetds.conf, which should be helpful if you're storing
> non-English text.
>
> Regards,
>
> --jkl
>
> ---
> You are currently subscribed to freetds as: [edeutsch AT systemsbiology.org]
> To unsubscribe, forward this message to
> leave-freetds-127899P AT franklin.oit.unc.edu
>

--
----------------------------------------------------------------------
Eric Deutsch email: edeutsch AT systemsbiology.org
Institute for Systems Biology Voice: (206) 732-1397
1441 N 34th St FAX: (206) 732-1260
Seattle, WA 98103-8904 http://www.systemsbiology.org/





Archive powered by MHonArc 2.6.24.

Top of Page