title: Exit from stored procedure in sybase
body: <p>I am getting some parameters in my stored procedure. Before operating on these parameters, I want to validate them and if the parameters are not as per the requirement then I want to exit from the stored procedure with an error message.</p>
  
  <p>sample code:</p>
  
  <pre><code>   create proc abcd
      (
         zip   varchar(20),
         name   varchar(20),
         network varchar(1)
      )
  
      -- validation section
      IF (len(zip)&lt;&gt;5 OR LEN(zip)&lt;&gt;9)
      begin
            print "The zip must be of 5 or 9 characters"
            &lt;---- how to exit from here---&gt;
      end
      IF (len(name)&lt;2)
      begin
            print "The name must be of at least 2 characters"
            &lt;---- how to exit from here---&gt;
      end
  
  ---- main code
  </code></pre>
  
  <p>How can I exit the procedure once I get the error as mentioned above?</p>