MySQL Forums
Forum List  »  Quality Assurance

Update Trigger
Posted by: sriPathi n
Date: March 13, 2008 01:39AM

i have done a table in mysql, that table column value should be 2 whenever i tries to insert that value as null. i have tried with the following trigger but it is not allowed me to insert. what is the problem, please give a solution?

create trigger val_null after insert on tbl1 for each row
update tbl1 set col_val=”2” where col_val=null or col_val=’’ or col_val=’ ‘;

Options: ReplyQuote

Written By
Update Trigger
March 13, 2008 01:39AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.