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:
-
WHEREclauses can only be specified in the cache table definitions of aCREATE CACHE GROUPstatement for read-only and user managed cache groups. -
A
WHEREclause can be specified in aLOAD CACHE GROUPstatement 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
WHEREclause can be specified in aREFRESH CACHE GROUPstatement except on a cache group with autorefresh.See Manually Loading and Refreshing a Cache Group for more information about the
REFRESH CACHE GROUPstatement. -
A
WHEREclause can be specified in aFLUSH CACHE GROUPstatement 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 GROUPstatement. -
WHEREclauses in aCREATE CACHE GROUPstatement cannot contain a subquery. Therefore, eachWHEREclause cannot reference any table other than the one in its cache table definition. However, aWHEREclause in aLOAD CACHE GROUP,UNLOAD CACHE GROUP,REFRESH CACHE GROUPorFLUSH CACHE GROUPstatement may contain a subquery. -
A
WHEREclause in aLOAD CACHE GROUP,REFRESH CACHE GROUPorFLUSH CACHE GROUPstatement can reference only the root table of the cache group, unless theWHEREclause contains a subquery. -
All tables and columns referenced in
WHEREclauses when creating, loading, refreshing, unloading or flushing the cache group must be fully qualified. For example:owner.table_nameandowner.table_name.column_name