Handling Out-of-Range and Overflow
886270Sep 5 2011 — edited Sep 5 2011How to deal with Out-of-Range and Overflow?
Suppose I have a SQL table with one column of datatype “tinyint”.
tinyint’s range is 0-255.
Table:
create table xyz
( userid tinyint not null auto_increment,
…......
);
After inserting 256 rows, we cannot insert another row .
When MySQL stores a value in a numeric column that is outside the permissible range of the column data type, MySQL rejects the out-of-range value with an error, and the insert fails.
How to deal with this situation ?
Obviously we can use some data type with very big range for e.g. bigint .. but still every data type got some maximum limit. So, there must be a way through which we can deal with this situation.