Data Definition Language (DDL) Reference Manual
DDL Compiler Commands
Data Definition Language (DDL) Reference Manual—529431-004
9-95
SAVE
NOSAVE
purges the contents of the open dictionary when the dictionary is closed unless the
dictionary either:
•
Was opened for read-only access with the command DICTR on page 9-51
•
Is part of a Pathmaker project
The open dictionary closes in any of these situations:
•
The NODICT command executes (see DICT on page 9-47)
•
The DICT command opens another dictionary
•
Compilation stops
If an existing dictionary is opened for update and NOSAVE is in effect when the
dictionary is closed, the contents of the dictionary are purged. The NOSAVE command
is ignored if the dictionary is part of a Pathmaker project.
If the DDL compiler encounters an error while processing a statement that describes a
DDL object, it does not add that object to the dictionary. If the dictionary is saved
(either by default or because of an explicit SAVE command), it does not contain all the
DDL objects specified in the schema.
You can use the NOSAVE, ERRORS, and SAVE commands to ensure that a
dictionary is saved only if the entire schema is compiled without errors in one of two
ways:
•
Put a NOSAVE command and an ERRORS 1 command at the beginning of the
schema.
•
Put a SAVE command at the end of the schema.
If the DDL compiler encounters an error, compilation stops while NOSAVE is in effect,
and the dictionary is not saved. The dictionary is saved only if compilation completes
with no errors; thus, the dictionary either contains all the requested objects or it is
purged.
In Example 9-48
on page 9-96, ERRORS 1 directs the DDL compiler to cease
processing the schema when it encounters the first error. While NOSAVE is in effect, it
directs the compiler to purge the dictionary when compilation stops. The SAVE
command is executed only if compilation reaches the SAVE line with no errors.