Bob
Bob

Reputation: 1396

MySQL: Inserting into Table Confusion

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)

Upvotes: 0

Views: 37

Answers (1)

Milen Louis
Milen Louis

Reputation: 223

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

Upvotes: 2

Related Questions