Back to home page

OSCL-LXR

 
 

    


0001 ---
0002 layout: global
0003 title: REFRESH TABLE
0004 displayTitle: REFRESH TABLE
0005 license: |
0006   Licensed to the Apache Software Foundation (ASF) under one or more
0007   contributor license agreements.  See the NOTICE file distributed with
0008   this work for additional information regarding copyright ownership.
0009   The ASF licenses this file to You under the Apache License, Version 2.0
0010   (the "License"); you may not use this file except in compliance with
0011   the License.  You may obtain a copy of the License at
0012  
0013      http://www.apache.org/licenses/LICENSE-2.0
0014  
0015   Unless required by applicable law or agreed to in writing, software
0016   distributed under the License is distributed on an "AS IS" BASIS,
0017   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0018   See the License for the specific language governing permissions and
0019   limitations under the License.
0020 ---
0021 
0022 ### Description
0023 
0024 `REFRESH TABLE` statement invalidates the cached entries, which include data
0025 and metadata of the given table or view. The invalidated cache is populated in
0026 lazy manner when the cached table or the query associated with it is executed again.
0027 
0028 ### Syntax
0029 
0030 ```sql
0031 REFRESH [TABLE] table_identifier
0032 ```
0033 
0034 ### Parameters
0035 
0036 * **table_identifier**
0037 
0038     Specifies a table name, which is either a qualified or unqualified name that designates a table/view. If no database identifier is provided, it refers to a temporary view or a table/view in the current database.
0039 
0040     **Syntax:** `[ database_name. ] table_name`
0041 
0042 ### Examples
0043 
0044 ```sql
0045 -- The cached entries of the table will be refreshed  
0046 -- The table is resolved from the current database as the table name is unqualified.
0047 REFRESH TABLE tbl1;
0048 
0049 -- The cached entries of the view will be refreshed or invalidated
0050 -- The view is resolved from tempDB database, as the view name is qualified.
0051 REFRESH TABLE tempDB.view1;   
0052 ```
0053 
0054 ### Related Statements
0055 
0056 * [CACHE TABLE](sql-ref-syntax-aux-cache-cache-table.html)
0057 * [CLEAR CACHE](sql-ref-syntax-aux-cache-clear-cache.html)
0058 * [UNCACHE TABLE](sql-ref-syntax-aux-cache-uncache-table.html)
0059 * [REFRESH](sql-ref-syntax-aux-cache-refresh.html)