tags:

views:

16

answers:

1

I have this code (mySql 5.1.36)

CREATE TRIGGER problem_description AFTER INSERT ON problem_description
FOR EACH ROW BEGIN
INSERT INTO log SET Id=NEW.Id,user_name=NEW.user_name;
END;

and have this error:

#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 '' at line 3

A: 

When do you get this error message? When you create the trigger? You may need to use another delimiter than ; when you create your trigger.

delimiter //
create trigger problem_descriptor after insert on problem_description
    for each row begin
        insert into
            log
        set
            `Id`=NEW.`Id`,
            `user_name`=NEW.`user_name`;
    end;
//
delimiter ;
Björn
I get this message when create trigger
Ognjen
I use wamp server and after put your code phpMyadmin is blocked
Ognjen