Data Definition Language (DDL) Reference Manual
Dictionary Maintenance
Data Definition Language (DDL) Reference Manual—529431-004
10-9
Modifying Unreferenced Objects
Modifying Unreferenced Objects
Records, SPI token codes, and SPI token maps are never referenced by other objects.
Other types of objects can be referenced. You can use the SHOW USE OF command
to determine whether the object you want to modify is referenced by other objects.
To modify an object not referenced by other objects, build a source file that contains
the definition of the changed object, then compile this source file into the dictionary.
You can, of course, change the original schema directly and recompile the dictionary,
but this causes unnecessary processing if your dictionary is large.
To modify the object, do this:
1. Open the dictionary. Use a DICT or DICTN command to open the dictionary
containing the object to be modified.
2. Modify the object. To avoid recompiling the entire schema, write the object
definition from the dictionary to a DDL source file using an OUTPUT statement,
close the DDL source file, and then edit the object definition in the DDL source file.
3. Compile the modified object into the open dictionary. Run the DDL compiler with
the DDL source file as the input file, or compile the source file interactively with the
SOURCE command.
4. Modify your original schema if you plan to ever use it to rebuild the dictionary.
Suppose you want to add a new alternate key field, ORDERDATE, to the record
ORDERS defined in the sample database schema in Appendix B, Sample Schemas.
The new key field is already defined in the definition ORDERINFO. To specify the key
as an alternate key in ORDER-REC, use the OUTPUT statement to write the record
definition from the open dictionary to a DDL source file. Add the new key specifier to
the record definition, and then compile the record definition back into the dictionary
with a SOURCE command, as in Example 10-6 on page 10-9.
Example 10-6. Modifying an Unreferenced Object (page 1 of 2)
45> DDL DICT $data.sales
Run DDL and open dictionary
!?DDL newsrc !
Open and clear source file
!OUTPUT RECORD orders.
Loading Record ORDERS
DDL source output produced for ORDERS
Write record definition to source file
!?NODDL
Close source file
!?EDIT newsrc; LA
3 ?Section ORDERS
6 Record ORDERS
List and edit record ORDERS