conditional triggers in phpmyadmin
Posted: Thu Nov 27, 2008 12:35 pm
Hi I am trying to set conditional row trigger in phpmyadmin as shown below
CREATE TRIGGER temptri After insert on contact
for each Row
when(New.Age>20)
begin
insert into updates(uName,uAge,uAddr) values(New.Name,New.Age,New.Addr);
END;
I had made delimiter changes but i am getting some error like
MySQL said:
#1064 - 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 'when(New.Age>20)
begin
insert into updates(uName,uAge,uAddr) values(New.Name,N' at line 3
strange thing is if i take condition out trigger is working fine so in short where i should this condition check
CREATE TRIGGER temptri After insert on contact
for each Row
when(New.Age>20)
begin
insert into updates(uName,uAge,uAddr) values(New.Name,New.Age,New.Addr);
END;
I had made delimiter changes but i am getting some error like
MySQL said:
#1064 - 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 'when(New.Age>20)
begin
insert into updates(uName,uAge,uAddr) values(New.Name,N' at line 3
strange thing is if i take condition out trigger is working fine so in short where i should this condition check