Try OpenEdge Now
skip to main content
Programming Interfaces
Data Management : Database Access : Creating schema cache files : Building a schema cache file
 
Building a schema cache file
To build a schema cache file, you use the SAVE CACHE statement together with a connected database. You must first decide whether you need the entire schema cache or only the schema cache for selected tables of a database. If your application accesses all the tables in the database, you need the complete cache. Otherwise, you can build a schema cache file for only the tables that are accessed by your application.
In general, you build a schema cache file off-line, after making a schema change in the database. You can do this in the Procedure Editor directly, or you can write a small maintenance procedure to generate the file.
This is the syntax of the SAVE CACHE statement:

Syntax

SAVE CACHE { CURRENT | COMPLETE }
  database-name TO pathname
The databasename can be the literal logical name of any OpenEdge database or the VALUE(expression) option, where expression is a character expression that evaluates to the database name.
Note: For a DataServer, OpenEdge saves the schema cache for the entire schema holder database. You cannot save the schema cache for a non-OpenEdge database separately. For more information on schema cache files for DataServers, see your OpenEdge DataServer guide.
The pathname can be the literal pathname of an operating system file or the VALUE(expression) option, where expression is a character expression that evaluates to the pathname.
To save the entire schema cache:
1. Connect to the database.
2. Execute the SAVE CACHE statement using the COMPLETE option.
For an example procedure that saves the entire schema cache for one or more databases, see the SAVE CACHE Statement reference entry in OpenEdge Development: ABL Reference.
To save a partial schema cache for selected tables of a database:
1. Connect to the database.
2. Read each table you want to include in the schema cache with a FIND statement.
3. Execute the SAVE CACHE statement using the CURRENT option.
4. If you want to save a different partial schema cache for the same database, disconnect the database and repeat Steps 1 through 3.