Re: Preventing Negative values in table. ..oO(nopam_pcartier@atlashosting.com)
>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.
Your application should catch that, not the DB. Don't let your users
submit such values.
Micha |