How to declare variable in trigger with MySQL?

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!

  • Answer:

    Hope the link below might work for you. http://www.linkbucks.com/link/fc751dce/21090

alex at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

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.

Colinc

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.