<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h2 class="title">
      <a name="sql-compound-statements">
      </a>
      15.6 Compound Statement Syntax
     </h2>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="begin-end.html">
       15.6.1 BEGIN ... END Compound Statement
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="statement-labels.html">
       15.6.2 Statement Labels
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="declare.html">
       15.6.3 DECLARE Statement
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="stored-program-variables.html">
       15.6.4 Variables in Stored Programs
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="flow-control-statements.html">
       15.6.5 Flow Control Statements
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="cursors.html">
       15.6.6 Cursors
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="condition-handling.html">
       15.6.7 Condition Handling
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="condition-handling-restrictions.html">
       15.6.8 Restrictions on Condition Handling
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <a class="indexterm" name="idm46045176520912">
  </a>
  <a class="indexterm" name="idm46045176519872">
  </a>
  <a class="indexterm" name="idm46045176518384">
  </a>
  <a class="indexterm" name="idm46045176517312">
  </a>
  <p>
   This section describes the syntax for the
   <a class="link" href="begin-end.html" title="15.6.1 BEGIN ... END Compound Statement">
    <code class="literal">
     BEGIN ... END
    </code>
   </a>
   compound statement and other statements that can be used in the body
    of stored programs: Stored procedures and functions, triggers, and
    events. These objects are defined in terms of SQL code that is
    stored on the server for later invocation (see
   <a class="xref" href="stored-objects.html" title="Chapter 27 Stored Objects">
    Chapter 27,
    <i>
     Stored Objects
    </i>
   </a>
   ).
  </p>
  <p>
   A compound statement is a block that can contain other blocks;
    declarations for variables, condition handlers, and cursors; and
    flow control constructs such as loops and conditional tests.
  </p>
 </div>
 <br/>
</div>
