ibm-information-center/dist/eclipse/plugins/i5OS.ic.db2_5.4.0.1/rbafzmsthrefresh.htm

101 lines
5.8 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="dc.language" scheme="rfc1766" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<meta name="dc.date" scheme="iso8601" content="2005-09-19" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow"/>
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="keywords" content="REFRESH TABLE statement, REFRESH TABLE,
SQL statements, in REFRESH TABLE statement, table-name" />
<title>REFRESH TABLE</title>
<link rel="stylesheet" type="text/css" href="ibmidwb.css" />
<link rel="stylesheet" type="text/css" href="ic.css" />
</head>
<body>
<a id="Top_Of_Page" name="Top_Of_Page"></a><!-- Java sync-link -->
<script language = "Javascript" src = "../rzahg/synch.js" type="text/javascript"></script>
<a name="hrefresh"></a>
<h2 id="hrefresh"><a href="rbafzmst02.htm#ToC_1191">REFRESH TABLE</a></h2><a id="idx2974" name="idx2974"></a><a id="idx2975" name="idx2975"></a>
<p>The REFRESH TABLE statement refreshes the data in a materialized query
table. The statement deletes all rows in the materialized query table and
then inserts the result rows from the <var class="pv">select-statement</var> specified
in the definition of the materialized query table.</p>
<a name="wq1662"></a>
<h3 id="wq1662"><a href="rbafzmst02.htm#ToC_1192">Invocation</a></h3>
<p>This statement can be embedded in an application program or issued interactively.
It is an executable statement that can be dynamically prepared.</p>
<a name="wq1663"></a>
<h3 id="wq1663"><a href="rbafzmst02.htm#ToC_1193">Authorization</a></h3>
<p>The privileges held by the authorization ID of the statement must include
at least one of the following: </p>
<ul>
<li>For the table identified in the statement,
<ul>
<li>The system authority *OBJMGT on the table</li>
<li>The DELETE privilege on the table</li>
<li>The INSERT privilege on the table</li>
<li>The system authority *EXECUTE on the library containing the table</li></ul></li>
<li>Administrative authority</li></ul>
<p>For information on the system authorities corresponding to SQL privileges,
see <a href="rbafzmstgnt.htm#eqtablet">Corresponding System Authorities When Checking Privileges to a Table or View</a>.</p>
<a name="wq1664"></a>
<h3 id="wq1664"><a href="rbafzmst02.htm#ToC_1194">Syntax</a></h3>
<a href="rbafzmsthrefresh.htm#synrefresh"><img src="c.gif" alt="Click to skip syntax diagram" /></a>
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn363.htm"
border="0" /></span><a href="#skipsyn-362"><img src="c.gif" alt="Skip visual syntax diagram"
border="0" /></a> .-,--------------.
V |
>>-REFRESH TABLE------<span class="italic">table-name</span>---+--------------------------->&lt;
</pre>
<a name="skipsyn-362" id="skipsyn-362"></a>
<a name="synrefresh"></a>
<h3 id="synrefresh"><a href="rbafzmst02.htm#ToC_1195">Description</a></h3>
<dl class="parml">
<dt class="bold"><var class="pv">table-name</var> </dt><a id="idx2976" name="idx2976"></a>
<dd>Identifies the materialized table to be refreshed. The table-name must
identify a materialized query table that exists at the current server. REFRESH
TABLE evaluates the <var class="pv">select-statement</var> in the definition of the materialized
query table to refresh the table.
</dd>
</dl>
<a name="wq1665"></a>
<h3 id="wq1665"><a href="rbafzmst02.htm#ToC_1196">Notes</a></h3>
<p><span class="bold">Refresh use of materialized query tables:</span> No
materialized query tables are used to evaluate the <var class="pv">select-statement</var> during
the processing of REFRESH TABLE statement.</p>
<p><span class="bold">Refresh isolation level:</span> The isolation level used
to evaluate the <var class="pv">select-statement</var> is either:</p>
<ul>
<li>the isolation level specified on the <var class="pv">isolation-level</var> clause of
the <var class="pv">select-statement</var>, or</li>
<li>if the <var class="pv">isolation-level</var> clause was not specified, the isolation
level of the materialized query table recorded when CREATE TABLE or ALTER
TABLE was issued.</li></ul>
<p><span class="bold">Number of rows:</span> After successful execution of a REFRESH
TABLE statement, the ROW_COUNT statement information item in the SQL Diagnostics
Area (or SQLERRD(3) in the SQLCA) will contain the number of rows inserted
into the materialized query table.</p>
<a name="wq1666"></a>
<h3 id="wq1666"><a href="rbafzmst02.htm#ToC_1197">Example</a></h3>
<p>Refresh the data in the TRANSCOUNT materialized query table.</p>
<pre class="xmp"> <span class="bold">REFRESH TABLE</span> TRANSCOUNT</pre><a id="idx2977" name="idx2977"></a><a id="idx2978" name="idx2978"></a>
<hr /><br />
[ <a href="#Top_Of_Page">Top of Page</a> | <a href="rbafzmstpreph2.htm">Previous Page</a> | <a href="rbafzmstrele.htm">Next Page</a> | <a href="rbafzmst02.htm#wq1">Contents</a> |
<a href="rbafzmstindex.htm#index">Index</a> ]
<a id="Bot_Of_Page" name="Bot_Of_Page"></a>
</body>
</html>