View Single Post

   
  #2 (permalink)  
Old 02-28-2008, 05:52 AM
Dan Nelson
 
Posts: n/a
Default Re: using contraints on Mysql

In the last episode (Feb 25), Raúl Andrés Duque Murillo said:
> I'm looking for using FIELD CONSTRAINTS on Mysql but I can't find
> it ... Doesn't Mysql implement it??
>
> For example:
> age int > 0


You can do those checks with triggers:

http://dev.mysql.com/doc/refman/5.0/en/triggers.html

# If a BEFORE trigger fails, the operation on the corresponding row
is not performed.

--
Dan Nelson
dnelson@allantgroup.com
Reply With Quote