Possible Duplicate: raise error within MySql function
how to achive raiseerror functionality in MySql?