MySQL Forums
Forum List  »  Triggers

Re: Need Help with TRIGGER and IF
Posted by: Peter Brawley
Date: October 23, 2012 11:50AM

The one-word answer is: normalise!

Column names test1...test15 strongly suggest a table design problem. That is, if instead of (id int primary key, test1 char(16),... test15 char(16) ), you had ...

overall(oid int primary key, name char...)
tests(
  tid int primary key, 
  oid int, foreign key(oid) references overall(oid),
  result char(16))
)

then a simple sql command ...

update tests set result='fail' where ord=so-and-so;

would accomplish your task.

Options: ReplyQuote


Subject
Views
Written By
Posted
2543
October 23, 2012 10:17AM
Re: Need Help with TRIGGER and IF
1524
October 23, 2012 11:50AM
1446
October 23, 2012 01:53PM
1267
October 23, 2012 03:58PM


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.