Question

Locked

MySQL INT data type

By Sumitha Mani ·
Hi,

I have started working in MySQL recently. I tried to import an excel into mysql table. everything is fine but for one column. I have defined a column called 'telephone_no' with int(30) as datatype. the data in the table after importing is absurd for a few records.. rest of the records seem fine. Dont know what is wrong. for example, i tried to insert the number '2825861214' but i get this number '2147483647'.. Please could anyone tell me what the problem and solution is ?

thank you

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Thanks !

by Sumitha Mani In reply to MySQL INT data type

I should have used BIGINT. thanks

Collapse -

Be careful with that size stuff

by Tony Hopkinson In reply to Thanks !

30 is the number of characters the value can take up in a fixed width field of the file.

BigInt (signed by default) takes up a maximum of 19 digits, unsigned it's 21 (I think) so you are allocating space that can never be used for the underlying data type. Character data type with a format specifier for input is better for telephone numbers anyway.

Back to Software Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums