SQL Query -
CREATE TRIGGER `trigger_insert` AFTER INSERT ON `user`
FOR EACH ROW BEGIN
INSERT INTO `credentials` (`UserId`,`Password`,`UserType`,`Status`)
VALUES (NEW.UserId,NEW.Password,'2',NEW.Status);
END;
DELIMITER ;
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
Need help... thanks in advance :)..
For your case you can use this statement -
CREATE TRIGGER `trigger_insert` AFTER INSERT ON `user`
FOR EACH ROW
INSERT INTO `credentials` (`UserId`,`Password`,`UserType`,`Status`) VALUES (NEW.UserId,NEW.Password,'2',NEW.Status);