Skip to Content.
Sympa Menu

freetds - Re: Example source codes

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Brian Bruns <camber AT umcc.ais.org>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Example source codes
  • Date: Thu, 2 Sep 1999 07:50:34 -0400 (EDT)


Mark,

Is HW_BIG_ENDIAN a good way to check if we need to do a memcpy or use a
cast? If memory serves, Alpha tends not to like unaligned access as well
and is little endian. Does anyone know if there is a way to determine
alignment boundries? (I think perl does this during its config). Is
there an autoconf macro to do this that we should be checking for?

Brian

On Wed, 1 Sep 1999, Mark Schaal wrote:

>
> I have a patch that should work for money->flt8 and I'll be looking at
> fixing up the other non-BLOB types.
>
> Mark
>
>
> *** src/tds/convert.c Wed Sep 1 15:20:26 1999
> --- src/tds/convert.c~ Wed Sep 1 14:52:46 1999
> ***************
> *** 346,350 ****
> {
> ! long high;
> ! unsigned long low;
> ! double dmoney;
>
> --- 346,348 ----
> {
> ! unsigned long dollars, hundreths,bignum;
>
> ***************
> *** 355,372 ****
> break;
> - case SYBFLT8:
> - #if defined(HW_LITTLE_ENDIAN)
> - high = *(long *)src;
> - low = *(long *)(src + 4);
> - #elif defined(HW_BIG_ENDIAN)
> - /* Using memcpy to avoid alignment (bus error)
> - * problems on SPARC. I don't know if there's
> - * a better way to do this.
> - */
> - memcpy(&high, src, 4);
> - memcpy(&low, src+4, 4);
> - #endif
> - dmoney = (double)high * 65536 * 65536 + (double)low;
> - dmoney = dmoney / 10000;
> - *(double *)dest = dmoney;
> - break;
> case SYBMONEY:
> --- 353,354 ----
>
> >
> > Ok, good question.
> >
> > My situation is: I am working on a FreeBSD 3.2 using dblib from
> > freetds to access data in a MS SQL Server 6.5. The database I am accessing
> > has 85 tables with total 854 columns. So, from now I am having to access
> > only types like money, float, real, char, varchar, smallint and int. The
> > list of all the types is below. I need to know if I will be able to access
> > the fields like datetime, timestamp, text and image. To access float and
> > real I have already received information from this discussion list. May I
> > suppose I will be able to deal with datetime and timestamp like strings?
> > And money like float/real? Well, I will test this soon and if nobody
> > answers this I may send the experience to the list.
> >
> > The types I have in the database:
> > binary
> > bit
> > datetime
> > float
> > identity
> > image
> > int
> > money
> > real
> > smallint
> > text
> > timestamp
> > tinyint
> > varchar
> >
> > []s,
> >
> > Carlos E. G. Carvalho
>
>
> --
> Mark J. Schaal Phone: (909)
> 620-7724
> TST On Ramp Fax: (909) 620-8174
> System Administrator E-Mail: mark AT tstonramp.com
>
> ---
> You are currently subscribed to freetds as: camber AT ais.org
> To unsubscribe, forward this message to $subst('Email.Unsub')
>
>





Archive powered by MHonArc 2.6.24.

Top of Page