title: Getting SQLEXCEPTION message in MySQL procedures
body: <p>How can I get error text in MySQL stored procedure when SQLEXCEPTION occurs?</p>
  
  <p>I need something like this:</p>
  
  <pre><code>DECLARE EXIT HANDLER FOR SQLEXCEPTION    
  BEGIN
      INSERT INTO my_log (error_message) 
      VALUES (SQLEXCEPTION.message);
  END;
  </code></pre>