title: MySQL - SQLSTATE Values
body: <p>I created a procedure in which if the input is equal to 0, the procedure will throw an SQLException with an error message of 'dwa'. </p>
  
  <pre><code>CREATE PROCEDURE enter_the_dragon(test INT)
  
  BEGIN
  
    DECLARE test_error CONDITION FOR SQLSTATE '42123';
  
    IF test = 0 THEN
  
      SIGNAL test_error
        SET MESSAGE_TEXT = 'dwa';
  
    END IF;
  
  END;
  </code></pre>
  
  <p>I am aware that SQLSTATE value '00000' means there's no error and SQLSTATE that starts with '01' is a warning. Does that mean that every SQLSTATE that doesn't collide with these two rules is an error?<br>
  Considering this rules, are there any other rules on SQLSTATE? Format? Or I am free to create my own SQLSTATE (ex. 01123 (warning) etc.)?</p>