tag:blogger.com,1999:blog-18337119.post113769414734310675..comments2024-01-22T07:09:30.574-05:00Comments on MySQL Consulting and NoSQL Consulting: MySQL DBA: Advice from the MySQL experts neededUnknownnoreply@blogger.comBlogger2125tag:blogger.com,1999:blog-18337119.post-18395800592919613482007-11-29T05:18:00.000-05:002007-11-29T05:18:00.000-05:00Hi maybe u can help me. I am really desperate, i t...Hi maybe u can help me. I am really desperate, i tried to write all MySQL forums but notobdy answers. I have this problem:<BR/><BR/>While creating a trigger on MySQL 5.5.33 as i put an "IF STATEMENT" inside like this one:<BR/><BR/>CREATE TRIGGER status_history_upd AFTER UPDATE ON projects<BR/>FOR EACH ROW<BR/><BR/>IF NEW.project_status != OLD.project_status THEN<BR/>INSERT INTO project_status_history<BR/>SET status_change_date = NEW.project_edit_date,<BR/>project_id = NEW.project_id,<BR/>status_id = NEW.project_status;<BR/>END IF;<BR/><BR/>for some reason it gives me back this error:<BR/><BR/>MySQL said:<BR/>#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 'INSERT INTO project_status_history<BR/>SET status_change_date = NEW.project_edi' at line 5<BR/><BR/>I really have to put the "IF STATEMENT" because i need to run the INSERT just in some cases.<BR/>If I remove the "IF STATEMENT" it works fine.<BR/><BR/>Can you please help?<BR/><BR/>Thanks<BR/><BR/>GabrieleArcangeloGabbriellohttps://www.blogger.com/profile/09179524389927092201noreply@blogger.comtag:blogger.com,1999:blog-18337119.post-1138038836101251592006-01-23T12:53:00.000-05:002006-01-23T12:53:00.000-05:00Thank you Scott for the URL :)Thank you Scott for the URL :)Frankhttps://www.blogger.com/profile/04086666898806120300noreply@blogger.com