2 messages in com.mysql.lists.mysqlbefore update trigger syntax| From | Sent On | Attachments |
|---|---|---|
| Ted Yu | 29 Nov 2006 19:42 | |
| ViSolve DB Team | 29 Nov 2006 20:58 |
| Subject: | before update trigger syntax![]() |
|---|---|
| From: | Ted Yu (ted...@yahoo.com) |
| Date: | 11/29/2006 07:42:53 PM |
| List: | com.mysql.lists.mysql |
Can someone tell me what's wrong with my before update trigger syntax ?
Thanks
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 19 to server version: 5.0.18-log
mysql> use eventtracker; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Database changed mysql> CREATE TRIGGER eat_lub BEFORE UPDATE ON EVENT_ACTION_TYPES -> FOR EACH ROW BEGIN -> SET NEW.LAST_UPDATED_BY = USER(); END; ERROR 1064 (42000): 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 'SET NEW.LAST_UPDATED_BY = USER()' at line 3 ERROR 1064 (42000): 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 'END' at line 1 mysql> CREATE TRIGGER eat_lub BEFORE UPDATE ON EVENT_ACTION_TYPES -> FOR EACH ROW BEGIN -> UPDATE EVENT_ACTION_TYPES SET NEW.LAST_UPDATED_BY = USER(); END; ERROR 1064 (42000): 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 'UPDATE EVENT_ACTION_TYPES SET NEW.LAST_UPDATED_BY = USER()' at line 3 ERROR 1064 (42000): 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 'END' at line 1
____________________________________________________________________________________ Cheap talk? Check out Yahoo! Messenger's low PC-to-Phone call rates. http://voice.yahoo.com




