You can specify a role for a field in a table where you wish to store the same type of information as an existing field. For example, on the MATERIAL table, we want to ensure that a material is reordered when there is a specific number left in stock. This means adding another field:
QUANTITY_IN_STOCK |
I5 |
REORDER_LEVEL |
I5 |
In both cases, the type of information is the same. A better way of identifying the fields is to use the same field name with different roles:
QUANTITY (IN_STOCK) |
I5 |
QUANTITY (REORDER_LEVEL) |
I5 |
Both fields are QUANTITY fields, and so share the same size and type checking, and the same upper and lower limits.
You can use the role facility to specify two links to a parent table. For example, the MATERIAL table includes two links to the SUPPLIER table:
SUPPLIER_NUMBER (PRINCIPAL) |
SUPPLIER_NUMBER (ALTERNATIVE) |
In this example, if the principal supplier cannot supply a material, the alternative supplier record is retrieved.