MySQL Forums
Forum List  »  Triggers

Trigger and LIKE SQL syntax
Posted by: Vic Sithasanan
Date: November 08, 2005 03:10AM

Hi there,

I would like to run an SQL statement within a trigger that has a LIKE statement. The only problem is I want to be able to do this:

select count(name) into old_name_count from store where name LIKE ('%NEW.name%');

I'm not able to do this in any form, i.e I can't get the % to bracket the NEW.name trigger variable. I can run this command:

select count(name) into old_name_count from store where name LIKE (NEW.name);

But can't figure out the syntax to run %NEW.name% so I can match any entry that contains this string.

Cheers.



Edited 2 time(s). Last edit at 11/08/2005 03:11AM by Vic Sithasanan.

Options: ReplyQuote


Subject
Views
Written By
Posted
Trigger and LIKE SQL syntax
6856
November 08, 2005 03:10AM
2592
November 08, 2005 08:27AM


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.