Dictionary Maintenance
Data Definition Language (DDL) Reference Manual — 426798-002
10- 2
Adding New Dictionary Objects
The following example re-creates the database schema for the dictionary on
$DATA.SALES and writes it to the new file SCHEMBAK:
Adding New Dictionary Objects
Adding a new dictionary object is usually easier than modifying an existing object
because a new object cannot be referenced by an existing object.
If statements describing new objects refer to previously defined objects in the
dictionary, the dictionary must be open.
When you add a new object, you must be careful that it does not have the same name
as an existing object of the same object type. If it does have the same name, DDL
replaces the existing object with the new object. If you try to add a new object that has
the same name but is of a different type (for example, a new constant with the same
name as an existing record), DDL issues an error message and does not replace the
existing object.
You can specify the new object in an interactive DDL session, but errors are not easy
to correct in a session. So if the object requires more than a few lines of code, it is
generally easier and safer to add a new object noninteractively. To add the object, you
specify the appropriate statements in a source file, open the dictionary, and compile
the source.
To add new objects to the dictionary, do this:
1. Specify the new objects.
2. Build an EDIT source file containing the statements that define the new objects.
3. Open the dictionary. You can include the DICT or DICTN command to open the
dictionary in the source file, or you can specify it later when you compile the source
file.
4. Compile the source file. You can do this by running DDL interactively and using a
SOURCE command to specify the source file, or you can use the DDL run
command and specify the source file as the IN parameter.
39> DDL
!?DICT $data.sales
!?DDL $data.sales.schembak !
!OUTPUT *.
!EXIT
Open the dictionary
Open a new source file
VST1001.vsd