Including Substructures 

Prerequisites

You can only include flat structures as a substructure in a table or structure. No field refers to another structure in a flat structure. All the fields of a flat structure therefore refer either to a data element or were directly assigned a data type and field length with Direct type entry.

Procedure

  1. Position the cursor under the line in which you want to insert the substructure and choose Extras ® Substructures ® Insert substructure.
  2. A dialog box appears.

  3. Enter the name and (optionally) a three-place suffix for the substructure to be inserted.
  4. The suffix can be used to avoid name collisions between fields of the substructure and fields already in the table. The suffix is added to all the fields of the substructure, whereby the field name is first truncated if necessary.

  5. Choose Continue.
  6. A line with.INCLUDE in the field Field name and the name of the substructure in the field Data element is inserted in the field maintenance screen for the table.

  7. Select column Key if all the included fields should be key fields of the table. The table key must be at the start of the field list. If you select column Key, you must insert the substructure after the last key field or between the existing key fields of the table.
  8. If you do not select column Key, none of the included fields is a key field of the table.

  9. Save your entries and activate the table.

You can find information on the activation process in the activation log. You can display this log with Utilities ® Activation log. The activation log is displayed immediately if errors occur when the table is activated.

Result

The fields of the substructure are added to the table in the database. If you inserted the fields of the substructure as key fields, the primary index of the table is built again.

Other Options

You can display the fields contained in a substructure by positioning the cursor on the corresponding line and choosing Extras ® Substructures ® Explode substructure. The fields of the substructure appear directly below the line containing the substructure. You can cancel this action with Extras ® Substructures ® Retrieve substruct.

You can explode all the substructures in a table with Extras ® Substructures ® Explode all substr. You can cancel this action with Extras ® Substructures ® Retrieve all substr.

Choose Extras ® Substructures ® Insert substr. fields to copy the fields contained in the substructure directly into the table. The fields of the substructure become table fields. They are no longer adjusted to changes in the substructure.

See also:

Substructures