Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Handling Out-of-Range and Overflow

886270Sep 5 2011 — edited Sep 5 2011
How 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 3 2011
Added on Sep 5 2011
3 comments
628 views