<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="leave">
      </a>
      15.6.5.4 LEAVE Statement
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045176259088">
  </a>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa78481888"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">LEAVE</span> <em class="replaceable">label</em></code></pre>
  </div>
  <p>
   This statement is used to exit the flow control construct that
        has the given label. If the label is for the outermost stored
        program block,
   <a class="link" href="leave.html" title="15.6.5.4 LEAVE Statement">
    <code class="literal">
     LEAVE
    </code>
   </a>
   exits the
        program.
  </p>
  <p>
   <a class="link" href="leave.html" title="15.6.5.4 LEAVE Statement">
    <code class="literal">
     LEAVE
    </code>
   </a>
   can be used within
   <a class="link" href="begin-end.html" title="15.6.1 BEGIN ... END Compound Statement">
    <code class="literal">
     BEGIN ...
        END
    </code>
   </a>
   or loop constructs
        (
   <a class="link" href="loop.html" title="15.6.5.5 LOOP Statement">
    <code class="literal">
     LOOP
    </code>
   </a>
   ,
   <a class="link" href="repeat.html" title="15.6.5.6 REPEAT Statement">
    <code class="literal">
     REPEAT
    </code>
   </a>
   ,
   <a class="link" href="while.html" title="15.6.5.8 WHILE Statement">
    <code class="literal">
     WHILE
    </code>
   </a>
   ).
  </p>
  <p>
   For an example, see
   <a class="xref" href="loop.html" title="15.6.5.5 LOOP Statement">
    Section 15.6.5.5, “LOOP Statement”
   </a>
   .
  </p>
 </div>
 <br/>
</div>
