skip to main content
Using the Driver : Using Client-Side Caches : Creating a Cache
  

Try DataDirect Drivers Now

Creating a Cache

You create a cache using the Create Cache statement (refer to "Create Cache (EXT)"). A cache can be created on a single table or on a set of related tables. When creating a cache on a single table, you specify the name of the table to cache and can optionally specify a filter for the table. The filter determines whether the cache holds all of the data in the remote table or a subset of the data that matches the filter. You can also specify attributes for the Create Cache statement that determine:
*Whether the cache data is held on disk or in memory
*How often the cache data is refreshed
*Whether the cache is initially enabled
*Whether the driver checks to see if a refresh is needed at connect time
Creating a cache for a set of related tables is similar to creating a cache on a single table except that a primary table and one or more referencing tables are specified. This is useful if you want to cache a subset of data for a table and also cache data related to that subset of data. For example, you might have three tables, Account, Contact, and Opportunity, where both a contact and an opportunity belong to a particular account. Using a relational cache, you could specify that accounts that have had activity in the past year be cached, as well as caching the opportunities and contacts for only those cached accounts.