freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: Mark Schaal <mark AT champ.tstonramp.com>
- To: freetds AT franklin.oit.unc.edu
- Subject: Re: Example source codes
- Date: Wed, 1 Sep 1999 15:44:09 -0700 (PDT)
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
-
Re: Example source codes,
Carlos E. G. Carvalho, 09/01/1999
- <Possible follow-up(s)>
- Re: Example source codes, Mark Schaal, 09/01/1999
- Re: Example source codes, Brian Bruns, 09/02/1999
- Re: Example source codes, Mark Schaal, 09/02/1999
- Re: Example source codes, Mark Schaal, 09/03/1999
Archive powered by MHonArc 2.6.24.