OK something weird is going on and I can’t figure it out. I’m creating some triggers, but I get strange errors when trying to create them on the live DB. A sample query is this:
delimiter |
CREATE TRIGGER debug_upd_before BEFORE UPDATE ON properties_availability
FOR EACH ROW BEGIN
INSERT INTO debug_upd_before SET timestamp = NOW(), avID = OLD.avID, avPropertyID = OLD.avPropertyID,
avAvailableFrom = OLD.avAvailableFrom, avAvailableTo = OLD.avAvailableTo, avPrice = OLD.avPrice,
avIsAvailable = OLD.avIsAvailable;
END|
...
which executes fine localy. I’m using phpmyadmin, cause I don’t have any other access to the online DB. I know I don’t have full permissions and think that it might have something to do with that, but the error I get is:
You have an error in your SQL syntax;
check the manual that corresponds to
your MySQL server version for the
right syntax to use near ‘delimiter |
not “you don’t have permissions to do that” or something like that. The same happens when I try to execute something simpler like:
delimiter |
select 1|
select 2
The error I get is the same and I can’t set a delimiter and the default doesn’t work for me cause I have to use after the queries inside the triggers. I tried other symbols as delimiters, but the result is the same. Any ideas as to what the problem is and how to avoid it? Some of the triggers execute more than one query, if that makes a difference…
Thanks!
Try this statement (without delimiters) –