At 18:42 -0800 12/14/03, A Pasetti wrote:
When attempting to insert an integer into an integer
column, a different value is being inserted for the
given row. Check out the sql below to see what I mean.
The integer 7819359281 is somehow changed to
2147483647 when it's inserted.

Have you considered what the maximum value for an INT column is?

You might want to have a look at this section of the manual:

http://www.mysql.com/doc/en/Numeric_types.html

Also, see what the end of this section has to say about
inserting out-of-range values:

http://www.mysql.com/doc/en/INSERT.html


Perhaps someone has experienced this problem and could suggest a fix. I'm using MySQL 4.0.

Your advice will be greatly appereciated.

Thanks,

Andrew Pasetti

*****SQL QUERY RESULTS BELOW*********

mysql> create table TmpPhoneNumbers
    -> (
    -> token char(12) not null,
    -> number int(12) primary key
    -> );
Query OK, 0 rows affected (0.05 sec)

mysql> insert into TmpPhoneNumbers (token,number)
values ('dabw6pz6zkbc',7819359281);
Query OK, 1 row affected (0.05 sec)

mysql> select * from TmpPhoneNumbers;
+--------------+------------+
| token        | number     |
+--------------+------------+
| dabw6pz6zkbc | 2147483647 |
+--------------+------------+
1 row in set (1.06 sec)


--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

Are you MySQL certified? http://www.mysql.com/certification/


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to