title: How to insert the SQL Error message into table
body: <p>I want to store the error messages which occurs while executing the stored procedure in another error table.
  Here is the my sample procedure having some error statements.</p>
  
  <pre><code>    DELIMITER $$
      DROP PROCEDURE IF EXISTS `test`$$
      CREATE PROCEDURE `test`()
      BEGIN
          SELECT * FROM emp;
  
      END $$
      DELIMITER $$;
  </code></pre>
  
  <p>When i call the above procedure it gives me error.I wnat to store this error code &amp; message in another table as "error".
  Any pointers are appreciated.
  Thanks in Advance. </p>