Defining an item Schema DDL
64 U929-J-Z125-9-76
4.2.7 Defining a database key item ⎧DAT ABASE-KEY. ⎫
[level-number ]item-name TYPE IS ⎨ ⎬
⎩DATAB ASE-KEY-LONG.⎭
Database key items are binary items that are intended for storing data base key values. At
the same time, they are the only items whose contents are interprete d by UDS/SQL as
database key values.
Database key items must be defined by the database programmer if the datab ase key
values are not implicitly defined by UDS/SQL (see section “Assignment of data base key
values by the user” on page 85).
level-number denotes whether the item is part of a repeating group:
If the item is not to be part of a repeating group, the specified level number should be the
smallest level number in the whole record type.
This is especially important if the item is to be used as a key item.
If the item is to be part of a repeating group, proceed as descr ibed on page 66.
A database key item can be defined as an item of type DATABASE-KEY or
DATABASE-KEY-LONG:
– A DATABA SE-KEY item is a binary item of 4-byte length with a value range from
0 - 231-1.
– A DATABAS E-KEY-LONG item is a binary item of 8-byte length with a value range from
0 - 263-1. Note that the bit positions 17 - 32 (from the left) are not evaluated by
UDS/SQL.
The structure of database key values is described in detail on page 13 2.
A database key item must be supplied with values by the database programmer.
This allows the database programmer to independently define the database key
value used by UDS/SQL (see LOCATION MODE clause on page 85).
Note, however, that the content of the database key item need not always match the
value used internally by UDS/SQL for the database key of the record.
i