Sorry for responding to my own message. I figured this out.
DELIMITER //
CREATE TRIGGER only_this AFTER INSERT ON table_a
FOR EACH ROW
BEGIN
IF NEW.email_addr LIKE '[EMAIL PROTECTED]' THEN
INSERT INTO table_b (email_addr,value) VALUES (NEW.email_addr,0);
END IF;
END
On Saturday, January 7, 2006 at 2:39:07 AM, [EMAIL PROTECTED] confabulated:
> Hello All,
> I've been racking my brain trying to figure out something. I'm
> relatively new to the arena of SQL and have been doing a bunch of
> reading and experimenting.
> I have found a need for a trigger that will fire after an insert
> into a table. The trigger needs to act only if the value of a field
> contains something.
> CREATE TRIGGER only_this AFTER INSERT ON table_a
> FOR EACH ROW
> INSERT INTO table_b (email_addr,value) values (NEW.email_addr,0);
> This trigger works fine. However, I only want it to fire when
> NEW.email_addr contains a specific domain name. This is the part
> that is causing me confusion.
--
"This message is made of 100% recycled electrons."
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]