Good day. There is a table:
CREATE TABLE buffer ( id INT PRIMARY KEY AUTO_INCREMENT, ad_type varchar(20), price varchar(20), description varchar(1000), params varchar(500), image varchar(300), ins_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ); As well as the table source tbl_temp with fields type, price, comments, house, level, photo. Trying to make a trigger:
CREATE TRIGGER 'update_tbl' AFTER INSERT ON 'tbl_temp' FOR EACH ROW BEGIN INSERT INTO buffer SET ad_type = NEW.type, price = REPLACE(NEW.price, 'руб.',''), description = NEW.comments, ad_params = CONCAT(NEW.house, ' ', level), image = NEW.photo END; I get the error:
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_tbl' AFTER INSERT ON 'tbl_temp' FOR EACH ROW BEGIN INSERT IN' at line 1 I realized that there was an error in INSERT, but that’s where I didn’t figure it out. Could you help me?
Thank!