<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="alter-view">
      </a>
      15.1.11 ALTER VIEW Statement
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045188357360">
  </a>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa35739202"><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">ALTER</span>
    <span class="token punctuation">[</span><span class="token keyword">ALGORITHM</span> <span class="token operator">=</span> {<span class="token keyword">UNDEFINED</span> <span class="token operator">|</span> <span class="token keyword">MERGE</span> <span class="token operator">|</span> <span class="token keyword">TEMPTABLE</span>}<span class="token punctuation">]</span>
    <span class="token punctuation">[</span><span class="token keyword">DEFINER</span> <span class="token operator">=</span> <span class="token keyword"><em class="replaceable">user</em></span><span class="token punctuation">]</span>
    <span class="token punctuation">[</span><span class="token keyword">SQL</span> <span class="token keyword">SECURITY</span> { <span class="token keyword">DEFINER</span> <span class="token operator">|</span> <span class="token keyword">INVOKER</span> }<span class="token punctuation">]</span>
    <span class="token keyword">VIEW</span> <em class="replaceable">view_name</em> <span class="token punctuation">[</span><span class="token punctuation">(</span><em class="replaceable">column_list</em><span class="token punctuation">)</span><span class="token punctuation">]</span>
    <span class="token keyword">AS</span> <em class="replaceable">select_statement</em>
    <span class="token punctuation">[</span><span class="token keyword">WITH</span> <span class="token punctuation">[</span><span class="token keyword">CASCADED</span> <span class="token operator">|</span> <span class="token keyword">LOCAL</span><span class="token punctuation">]</span> <span class="token keyword">CHECK</span> <span class="token keyword">OPTION</span><span class="token punctuation">]</span></code></pre>
  </div>
  <p>
   This statement changes the definition of a view, which must exist.
      The syntax is similar to that for
   <a class="link" href="create-view.html" title="15.1.23 CREATE VIEW Statement">
    <code class="literal">
     CREATE
      VIEW
    </code>
   </a>
   see
   <a class="xref" href="create-view.html" title="15.1.23 CREATE VIEW Statement">
    Section 15.1.23, “CREATE VIEW Statement”
   </a>
   ). This statement
      requires the
   <a class="link" href="privileges-provided.html#priv_create-view">
    <code class="literal">
     CREATE VIEW
    </code>
   </a>
   and
   <a class="link" href="privileges-provided.html#priv_drop">
    <code class="literal">
     DROP
    </code>
   </a>
   privileges for the view, and
      some privilege for each column referred to in the
   <a class="link" href="select.html" title="15.2.13 SELECT Statement">
    <code class="literal">
     SELECT
    </code>
   </a>
   statement.
   <a class="link" href="alter-view.html" title="15.1.11 ALTER VIEW Statement">
    <code class="literal">
     ALTER VIEW
    </code>
   </a>
   is permitted only to the
      definer or users with the
   <a class="link" href="privileges-provided.html#priv_set-any-definer">
    <code class="literal">
     SET_ANY_DEFINER
    </code>
   </a>
   or
   <a class="link" href="privileges-provided.html#priv_allow-nonexistent-definer">
    <code class="literal">
     ALLOW_NONEXISTENT_DEFINER
    </code>
   </a>
   privilege.
  </p>
 </div>
 <br/>
</div>
