freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: [freetds] Problem with datetime from a MS SQL Server
- 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: Mon, 10 Feb 2003 21:18:13 -0500 (EST)
On Mon, 10 Feb 2003, Steve Langasek wrote:
> However, since the type of all the members is the same, I don't think the
> added protection against accidental name collisions justifies the
> portability hit. I think it's better to use #defines, like so:
>
> #define dateyear year
> #define datedmonth day
> #define datedyear dayofyear
>
> typedef struct dbdaterec
> {
> DBINT year;
> DBINT datemonth;
> DBINT month;
> DBINT day;
> DBINT dayofyear;
> [...]
> } DBDATEREC;
>
> using the more esoteric of the names for the member as the alias, to
> reduce the chance of colliding with app variable names.
>
> Failing that, it's always possible to double the structure. <shrug>
Problem is, what goes in the some fields is different, datemonth != month
so some doubling is a given. I dislike unqualified defines as does any
dblib programmer who has to include another library that defines the type
"BYTE". bad bad bad. By nature, they'd have to be globally visible.
The memory cost of doubling is pretty insignificant (nobody stores many
DBDATERECs that I can think of, they are pretty much throw away
structures), and the processing amounts to half dozen extra mov ops.
Anybody see downsides to this approach?
-
[freetds] Problem with datetime from a MS SQL Server,
Frank M. Kromann, 02/09/2003
- Re: [freetds] Problem with datetime from a MS SQL Server, James K. Lowden, 02/09/2003
- <Possible follow-up(s)>
-
RE: [freetds] Problem with datetime from a MS SQL Server,
Lowden, James K, 02/10/2003
-
Re: [freetds] Problem with datetime from a MS SQL Server,
Steve Langasek, 02/10/2003
- Re: [freetds] Problem with datetime from a MS SQL Server, Brian Bruns, 02/10/2003
-
Re: [freetds] Problem with datetime from a MS SQL Server,
James K. Lowden, 02/10/2003
-
Re: [freetds] Problem with datetime from a MS SQL Server,
Steve Langasek, 02/10/2003
- Re: [freetds] Problem with datetime from a MS SQL Server, James K. Lowden, 02/11/2003
-
Re: [freetds] Problem with datetime from a MS SQL Server,
Steve Langasek, 02/10/2003
-
Re: [freetds] Problem with datetime from a MS SQL Server,
Steve Langasek, 02/10/2003
- RE: [freetds] Problem with datetime from a MS SQL Server, ZIGLIO Frediano, 02/10/2003
- RE: [freetds] Problem with datetime from a MS SQL Server, ZIGLIO Frediano, 02/11/2003
- RE: [freetds] Problem with datetime from a MS SQL Server, Lowden, James K, 02/11/2003
Archive powered by MHonArc 2.6.24.