I am creating a trigger in MySQL and am getting an 'unknown system variable' on 'unique_id' which is a row in my 'pending_jobs' table. The trigger code is below:
CREATE TRIGGER format_pending_jobs_unique
BEFORE INSERT ON pending_jobs
FOR EACH ROW
BEGIN
SET unique_id = CONCAT(prefix_unique_id, id);
END
Basically it's concatenating the two rows (prefix_unique_id and id) into the row unique_id when a new row is inserted. The prefix_unique_id row has a default value of "sa" which will be the value of all of them and the id is the index of the row with auto increment. I'm new to triggers and I had read in a post on Stack Overflow to use := instead of = but that didn't fix the problem. I'm using phpMyAdmin and see that the unique_id (as well as the prefix_unique_id and id) rows all exists. Any help would be great. Thanks!