Interview Question in SQL Server Triggers


 

Interview Question :: MySQL syntax help syntax error creating trigger


I'm trying to create a trigger... Why doesn't this work:

create trigger idx_trigger AFTER INSERT ON idx_datafeed_Plus_Residential_BH FOR EACH ROW
BEGIN
insert into idx_datafeed_Plus_Residential_KEYS SET IMPORT_FILE_DATE = '2008-08-02' ;
END;


The error I get is:

ERROR 1064 (42000) at line 14: 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 'insert into idx_datafeed_Plus_Residential_KEYS SET IMPORT_FILE_DATE = '2008-08' at line 3


thanks!
Answers to "MySQL syntax help syntax error creating trigger"
RE: MySQL syntax help syntax error creating trigger?

What on earth are you trying to achieve? This looks extremely complex just to put in a date. And you can NOT use a set on an insert.
 
Vote for this answer ::  
RE: MySQL syntax help syntax error creating trigger?

Hope the link below might work for you.



http://www.linkbucks.com/link/fc751dce/2...
 
Vote for this answer ::  
Update Alert Setting