Skip to Content.
Sympa Menu

freetds - Numeric

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: ZIGLIO Frediano <Frediano.Ziglio AT vodafoneomnitel.it>
  • To: "Freetds (E-mail)" <freetds AT franklin.metalab.unc.edu>
  • Subject: Numeric
  • Date: Thu, 18 Jul 2002 10:20:24 +0200


Coding of numeric (and decimal) in different TDS version is different. It
seem that TDS 4.2 and 5.0 use always big endian conversion and TDS7/8 use
always little endian.
Also MS SQL is limited to 38, Sybase to 77 (128 and 256 bit).
So for Sybase a require data to be 33, not 17 (see tds.h.in).
Also we have a global g__numeric... (I don't remember exactly, an array)
variable for calculate numeric length. This variable is initialized globally
on connection. This cause two problem:
- calling convert to/from numeric before connecting can cause big problem
(core dump and other) and wrong conversion
- a single process cannot connect to Sybase and SQL Server also

I suggest following thing (as already done for int types in token.c):
defined a platform specific TDSNUMERIC and convert received wire numeric to
this format ASAP.
This solve previous problems too.
Also we should redefine TDSNUMERIC definition and review conversion to API
(ODBC support numeric up to 77 digit??)

freddy77

=================================
"STRICTLY PERSONAL AND CONFIDENTIAL

This message may contain confidential and proprietary material for the sole
use of the intended recipient. Any review or distribution by others is
strictly prohibited. If you are not the intended recipient please contact
the sender and delete all copies.
The contents of this message that do not relate to the official business of
our company shall be understood as neither given nor endorsed by it."

=================================




Archive powered by MHonArc 2.6.24.

Top of Page