MySQL Forums
Forum List  »  Triggers

Re: Creating a trigger to search in another table...
Posted by: Rene van Geijn
Date: March 02, 2006 01:53AM

Rick,

This should work.

DELIMITER $$
CREATE TRIGGER trg_DATATABLE
BEFORE INSERT ON DATATABLE
FOR EACH ROW
BEGIN
SELECT Title
INTO NEW.Title
FROM GRIDTABLE
WHERE V1Low <= NEW.V1
AND V1High > NEW.V1
AND V2Low <= NEW.V2
AND V2High > NEW.V2
END;
$$

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

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Creating a trigger to search in another table...
2121
March 02, 2006 01:53AM


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.