raise application error Trigger in MySQL DBMS
<p>I am dealing with triggers in MySQL, and I want to add the raise application error, but my code indicates :</p>

<blockquote>
  <p>Error code 1064, SQL state 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 '(-20000,'Pay is below Texas minimum wage!');     </p>
  
  <p>END IF;</p>
  
  <p>END' at line 9</p>
</blockquote>

<p>and if I remove the part of raise application error, it works perfectly .</p>

<p>Trigger:</p>

<pre><code>DELIMITER @@
DROP TRIGGER IF EXISTS gmtt.after_update_mcorr @@

CREATE TRIGGER gmtt.after_update_mcorr
AFTER UPDATE ON gmtt.mcorr
FOR EACH ROW
BEGIN
       IF OLD.etat = '0' AND NEW.etat = '1' THEN
            INSERT INTO historique(message, User, dateHisto) VALUES (CONCAT( 'a achevé la Maintenance ', OLD.codeMaint) , CURRENT_USER(), NOW()); 
       ELSE
raise_application_error(-20000,'Pay is below Texas minimum wage!');     

    END IF;

    END @@ 
DELIMITER ;
</code></pre>