Data Definition Language (DDL) Reference Manual

Introduction to DDL
Data Definition Language (DDL) Reference Manual529431-004
1-12
Maintaining a Dictionary
If your native programs do not share host-language source code files with TNS
programs, you can direct the DDL compiler to align data optimally for the native TNS/R
or TNS/E environment. To do so, specify the command FIELDALIGN_SHARED8 on
page 9-58 when storing data in a dictionary. While DDL source code files generated
with SHARED8 alignment can be used by TNS and native programs, the performance
of TNS programs is degraded.
Maintaining a Dictionary
After a dictionary is created, change is inevitable. You might need to add new objects
or to change or delete existing objects. DDL schema files help you perform these
maintenance functions.
The DDL compiler can generate schema statements from the dictionary and write
these statements to a DDL schema file. In its simplest role, a DDL schema file provides
a backup schema for DDL dictionaries created from the DDL compiler. Suppose the
dictionary but not the original schema has been changed, or suppose the original
schema is lost. In either case, the DDL compiler can generate a new schema that
accurately reflects the current dictionary and write this schema to a DDL schema file.
Do not attempt to back up a dictionary that is part of a Pathmaker catalog using this
technique. Pathmaker dictionaries contain application design information that is not in
generated DDL schemas.
The DDL compiler can compile the entire DDL schema file into a new dictionary just as
it compiled the original schema. The DDL compiler can also compile selected sections
of a schema file (or of any schema) and add them to an existing dictionary.
A DDL schema file is also useful for modifying dictionary objects that are used, or
referenced, by other objects. To change or delete an object that is referenced, you
must first delete all the objects that refer to that object, change the referenced object,
and then reenter the deleted objects. The DDL compiler can generate all the source
code necessary to perform these operations and write the source code to an open DDL
schema file. To update the dictionary, you need only compile this file, first modifying it if
necessary.
Figure 1-5
on page 1-13 shows two typical maintenance operations:
1. Add a new object to the dictionary.
Define the new object in a schema file. If you add the new object definition to your
original schema, precede the definition with a SECTION command. Then run the
DDL compiler interactively, and use a SOURCE command to compile the definition
in the schema and write the new object to the dictionary.
2. Change a referenced object.
Open the dictionary and a new DDL schema file. Use an OUTPUT UPDATE
statement to identify all objects that refer to the object you want to change and
write the necessary statements to the open DDL schema file. Close the schema