Click here to Skip to main content
16,016,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all.

i need write a Update trigger when the table's perticular column updated..

i tried the following query.

SQL
create Trigger Trigger1 after Update of EMPID on  EMPmaster for  each row
begin
insert into EMPMaster_Backup (OLDEMPID) values (EMPID );
end;



But it showing error .


SQL
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 'of EMPID on  EMPmaster for  each row
begin
insert into EMPMaster_Backup ' at line 1
Posted
Updated 30-Oct-12 5:54am
v2

1 solution

I think you cannot use Trigger itself as the name of your trigger.

http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html[^]

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900