And my question is, if you've defined your column to have (10,2) precision,
why would you try to insert a higher precision number?
dpk

----- Original Message -----
From: "Jim Dickenson" <[EMAIL PROTECTED]>
To: "Dana Powers" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, September 18, 2001 1:35 PM
Subject: Re: NUMERIC field contents


> On 9/18/01 11:25 AM, Dana Powers at [EMAIL PROTECTED] wrote:
>
> >
> >> The problem is that a number that is in the
> >> MySQL database might be a magnitude of 10 times larger than a number
that
> > is
> >> in the PostgreSQL database.
> >
> > Could you explain this?
> >
> > dpk
> >
> >
> > ---------------------------------------------------------------------
> > Before posting, please check:
> >  http://www.mysql.com/manual.php   (the manual)
> >  http://lists.mysql.com/           (the list archive)
> >
> > To request this thread, e-mail <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
> I create a table in PostgreSQL as a single field with numeric(10,2). I
> create the same table in MySQL. I then run an ODBC application that calls
> SQLDescribeCol to find out what items are returned from select * from
table.
> After getting a fix for MyODBC both data sources return a precision of 10
> and a scale of 2. This is as I would expect. I then know to add room for
the
> decimal point and the sign character. Even though I have room for a 12
digit
> number I expect the leftmost position to be used only for the sign.
>
> In PostgreSQL 7.1.3, using psql, if I try to put 123456789.12 into the
table
> I get an error that the number is too big to fit. This is as expected. If
I
> use mysql, Ver 11.15 Distrib 3.23.42 for pc-linux-gnu (i686), to put the
> same number into the table I do not get an error and the data is put into
> the database. This is not as expected.
>
> The reason I see this as a problem is that numeric(10,2) says that there
are
> 10 digits in the number and two of them are decimal digits. The valid
range
> is -99,999,999.99 through 99,999,999.99 but MySQL is allowing 11 digits to
> be put into the database.
>
> If my ODBC application expects data in a certain range based on the
> information returned from SQLDescribeCol then it will not be expecting to
> see a number with 11 digits in it.
>
> This is what I think is wrong with the behavior of MySQL.
> --
> Jim Dickenson
> mailto:[EMAIL PROTECTED]
>
> Computers for Marketing Corporation
> http://www.cfmc.com/
>
> eFax: 1-419-791-8924
>
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to