Preventing Negative values in table. Lets say I have a table:
create table test(
ID int unsigned default 0);
If someone was to update the table with the following statment:
UPDATE test SET ID = ID - 1
And the ID in the field was 0, this would cause a large numeric value
because it's an unsigned int,
is there a way to prevent this from happening, in the form of some trigger
or so.
My goal is not to have these values in the table, if the result is going to
cause invaild data, I want to somehow
prevent this.
Thanks
-Paul C |