<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="deallocate-prepare">
      </a>
      15.5.3 DEALLOCATE PREPARE Statement
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045176537616">
  </a>
  <a class="indexterm" name="idm46045176536576">
  </a>
  <a class="indexterm" name="idm46045176535504">
  </a>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa59305104"><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">DEALLOCATE</span> <span class="token operator">|</span> <span class="token keyword">DROP</span>} <span class="token keyword">PREPARE</span> <em class="replaceable">stmt_name</em></code></pre>
  </div>
  <p>
   To deallocate a prepared statement produced with
   <a class="link" href="prepare.html" title="15.5.1 PREPARE Statement">
    <code class="literal">
     PREPARE
    </code>
   </a>
   , use a
   <a class="link" href="deallocate-prepare.html" title="15.5.3 DEALLOCATE PREPARE Statement">
    <code class="literal">
     DEALLOCATE PREPARE
    </code>
   </a>
   statement that
      refers to the prepared statement name. Attempting to execute a
      prepared statement after deallocating it results in an error. If
      too many prepared statements are created and not deallocated by
      either the
   <code class="literal">
    DEALLOCATE PREPARE
   </code>
   statement or the
      end of the session, you might encounter the upper limit enforced
      by the
   <a class="link" href="server-system-variables.html#sysvar_max_prepared_stmt_count">
    <code class="literal">
     max_prepared_stmt_count
    </code>
   </a>
   system variable.
  </p>
  <p>
   For examples, see
   <a class="xref" href="sql-prepared-statements.html" title="15.5 Prepared Statements">
    Section 15.5, “Prepared Statements”
   </a>
   .
  </p>
 </div>
 <br/>
</div>
