TYPES - TABLE OF

Syntax

TYPES dtype { {TYPE tabkind OF [REF TO] type}
            | {LIKE tabkind OF dobj} }
            [WITH key] [INITIAL SIZE n].

Addition:

... INITIAL SIZE n

Effect

This statement defines a table type dtype with a specific row type, a table type tabkind, and a table key key.

The row type is determined by entering the data type type after TYPE and data type dobj after LIKE:

Addition

... INITIAL SIZE n

Effect

After the optional addition INITIAL SIZE, you can specify a number of rows n as a numeric literal or numeric constant to adjust the size of the first block in the memory that is reserved by the system for an internal table of the table type. Without this addition, if the number 0 is entered, or the value of n exceeds a maximum value, the system automatically allocates an appropriate memory area. If this is no longer sufficient, the system creates an additional block twice the size of the first block as long as this size does not exceed 8 KB. Additional areas are created where necessary with a size of 12 KB. The maximum value is calculated as 8 KB divided by the memory required for a row. In the case of larger values, a block size of 12 KB is automatically selected.

Note

You are advised to specify the initial memory requirements only when the number of entries in the table has already been specified and the initial main memory requirement has an adequate value. This can be especially important for internal tables that are components of table types and only contain a few rows.

Example

Definition of a non-generic sorted table type. The row type corresponds the structure of the database table SPFLI. Two key fields are defined for the table key.

TYPES spfli_sort TYPE SORTED TABLE OF spfli
      WITH UNIQUE KEY carrid connid.