Using a WHERE Clause
A cache table definition in a CREATE CACHE GROUP
statement can
contain a WHERE
clause to restrict the rows to cache in the TimesTen
database for particular cache group types.
You can also specify a WHERE
clause in a LOAD CACHE GROUP
, UNLOAD CACHE GROUP
, REFRESH CACHE GROUP
or FLUSH CACHE GROUP
statement for particular cache group types. Some statements, such as LOAD CACHE GROUP
and REFRESH CACHE GROUP
, may result in concatenated WHERE
clauses in which the WHERE
clause for the cache table definition is evaluated before the WHERE
clause in the LOAD CACHE GROUP
or REFRESH CACHE GROUP
statement.
The following restrictions apply to WHERE
clauses used in cache table definitions and cache group operations:
-
WHERE
clauses can only be specified in the cache table definitions of aCREATE CACHE GROUP
statement for read-only and user managed cache groups. -
A
WHERE
clause can be specified in aLOAD CACHE GROUP
statement except on a static cache group with autorefresh.See Manually Loading and Refreshing a Cache Group for more information about the
LOAD CACHE GROUP
. -
A
WHERE
clause can be specified in aREFRESH CACHE GROUP
statement except on a cache group with autorefresh.See Manually Loading and Refreshing a Cache Group for more information about the
REFRESH CACHE GROUP
statement. -
A
WHERE
clause can be specified in aFLUSH CACHE GROUP
statement on a user managed cache group that allows committed changes on the TimesTen cache tables to be flushed to the cached Oracle Database tables.See Flushing a User Managed Cache Group for more information about the
FLUSH CACHE GROUP
statement. -
WHERE
clauses in aCREATE CACHE GROUP
statement cannot contain a subquery. Therefore, eachWHERE
clause cannot reference any table other than the one in its cache table definition. However, aWHERE
clause in aLOAD CACHE GROUP
,UNLOAD CACHE GROUP
,REFRESH CACHE GROUP
orFLUSH CACHE GROUP
statement may contain a subquery. -
A
WHERE
clause in aLOAD CACHE GROUP
,REFRESH CACHE GROUP
orFLUSH CACHE GROUP
statement can reference only the root table of the cache group, unless theWHERE
clause contains a subquery. -
All tables and columns referenced in
WHERE
clauses when creating, loading, refreshing, unloading or flushing the cache group must be fully qualified. For example:owner
.
table_name
andowner
.
table_name
.
column_name