skip to main content
Reference : Supported SQL Statements and Extensions : Create Cache (EXT)
  

Try DataDirect Drivers Now

Create Cache (EXT)

Purpose

The Create Cache statement creates a cache that holds the data of a remote table. The data is not loaded into the cache when the Create Cache statement is executed; the data is loaded the first time that the remote table is executed or when a Refresh Cache statement on the remote table is executed. An error is returned if the remote table specified does not exist.

Syntax

CREATE CACHE ON {remote_table}
[REFRESH_INTERVAL {0 | -1 | interval_value [{M, H, D}]}]
[INITIAL_CHECK [{ONFIRSTCONNECT | FIRSTUSE | DEFAULT}]
[PERSIST {TEMPORARY | MEMORY | DISK | DEFAULT}]
[ENABLED {YES | TRUE | NO | FALSE}]
[CALL_LIMIT {0 | -1 | max_calls}]
[FILTER (expression)]
where:
remote_table
is the name of the remote table from which data is to be cached on the client. The name of the cached table is the same as the name of the remote table. When the table name is specified in a query, the cached table is accessed, not the remote table.
The remote table name can be a two-part name: schemaname.tablename. When specifying a two-part name, the specified remote table must be defined in the specified schema, and you must have the privilege to create objects in the specified schema.
REFRESH_INTERVAL
is an optional clause that specifies the length of time the data in the cached table can be used before being refreshed. See "Refresh Interval Clause" for a complete explanation.
INITIAL_CHECK
is an optional clause that specifies when the driver initially checks whether the data in the cache needs refreshed. See "Initial Check Clause" for a complete explanation.
PERSIST
is an optional clause that specifies the life span of the data in the cached table or view. See "Persist Clause" for a complete explanation.
ENABLED
is an optional clause that specifies whether the cache is enabled or disabled for use with SQL statements. See "Enabled Clause" for a complete explanation.
CALL_LIMIT
is an optional clause that specifies the maximum number of Web service calls that can be used to populate or refresh the cache. See "Call Limit Clause" for a complete explanation.
FILTER
is an optional clause that specifies a filter for the primary table to limit the number of rows that are cached in the primary table. See "Filter Clause" for a complete explanation.

Notes

*Caches on views are not supported.
*If two or more optional clauses are specified, they must be specified in the order shown in the syntax description.
In this section: 
* Refresh Interval Clause
* Initial Check Clause
* Persist Clause
* Enabled Clause
* Call Limit Clause
* Filter Clause