0

I'm not sure if I'm going crazy or what, but this seems like it shouldn't have any issue working but it gives an

"Out of range value for column 'contxt_id' at row 1" error

Insert Statement:

insert into contxt values(34000000000000000000, 'OIG', '110th BCT Frnd/Neut Org', null, 34000000000000000000, 0);

Description of Table:

mysql> describe contxt;
+-------------------+-------------+------+-----+---------+-------+
| Field             | Type        | Null | Key | Default | Extra |
+-------------------+-------------+------+-----+---------+-------+
| contxt_id         | int(20)     | NO   | PRI | NULL    |       |
| cat_code          | varchar(6)  | NO   |     | NULL    |       |
| name_txt          | varchar(80) | YES  |     | NULL    |       |
| security_clsfc_id | int(20)     | YES  | MUL | NULL    |       |
| creator_id        | int(20)     | NO   |     | NULL    |       |
| update_seqnr      | int(15)     | NO   |     | NULL    |       |
+-------------------+-------------+------+-----+---------+-------+
6 rows in set (0.02 sec)
Uttam Kumar Roy
  • 2,060
  • 4
  • 23
  • 29
Bob
  • 1,344
  • 3
  • 29
  • 63
  • 1
    http://stackoverflow.com/questions/23550231/long-integer-is-transformed-when-inserted-in-shorter-column-not-truncated-why/23550275#23550275 – Abhik Chakraborty Sep 02 '16 at 17:54

1 Answers1

2

The max limit of int is 2147483647. Hence to fix the error, change your datatype to VARCHAR

Milen Louis
  • 223
  • 4
  • 11