TRIGGER with error # 1064 on mysql

0

I have this code for a trigger on mysql and i looked for this type of error and ways to correct it but still do not work. below is the code.

CREATE TRIGGER 'tr_worklog' 
BEFORE INSERT ON 'total_worklog_bogota' 
FOR EACH ROW 
BEGIN 
    IF (NOT EXISTS(SELECT* FROM'total_worklog_bogota' WHERE Request_id = NEW.Request_id and Time_Spent_Technician = NEW.Time_Spent_Technician )) 
    THEN 

        INSERT INTO 'total_worklog_bogota' (Request_id, Requester ,Subject ,Time_Spent_Created_Time ,Time_Spent_Technician ,Time_Spent ,Site            ,Request_Status ,Created_Time ,Resolved_Time ,Completed_Time ,Client) 
        VALUES(NEW.Request_id ,NEW.Requester,NEW.Subject ,NEW.Time_Spent_Created_Time , NEW.Time_Spent_Technician ,NEW.Time_Spent ,NEW.Site             ,NEW.Request_Status ,NEW.Created_Time ,NEW.Resolved_Time ,NEW.Completed_Time ,NEW.Client)
    END IF
END 

and this is the error that show me

"# 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'END IF END 'at line 10 "

    
asked by Batty Uscategui 25.09.2018 в 18:35
source

0 answers