In the MIF, a table is composed of an array of group instances. Each instance of a group is a row in the table. Defining a table can be done in one of two ways:

The table definition actually identifies the data in the table rather than how the data is stored or changed. When you populate a table with a table definition, you identify a previous group definition in the component to be used as a template for the table.

The syntax for the table definition is:

start table      name = "table name"
      id = nnn
      class = "class string"

      { v1[,v2...] }
      [ { vn[, vm...] }
end table

The name statement is required for identification. The value of the ID statement must be unique across all other group and table definitions in the component. The class statement identifies the previous group definition that is being used as the template for this table.

For each row in the table, the values are specified between braces and conform to the format described by the value statement (Value Statement). The values are separated by commas and listed from left to right according to the attribute IDs that correspond to the values. The value of the attribute with the lowest ID is listed first. If a value in the list is omitted, the default value for the corresponding attribute is used if a default value is defined in the template. If no default value is defined, specify a value in the table definition. A row with too few commas is treated as a row with the trailing number of requisite commas, and the values specified in the template are used for the remaining attributes in the row.

A row with too few commas generates an error message from the DMI browser.

Sample Table Definition provides an example of how you can use a table definition to specify attribute values.
Sample Table Definition

    start table
        name = "sample table"
        id = 2
        class = "group2 class"
        {7,,,,,,,,,}
        {8,8,8,8,6678,"row 8","octet","20011024123515.000000-300",543,8}
        {9,-99,9,9,6767,"row 9","octet","99999999999.999999-999",333,20}
    end table

When populating rows within a table, you must provide unique values for the combination of attributes that make up the key. If the service layer is managing a MIF file and the MIF file does not provide unique keys, the service layer rejects the MIF file. As an example, consider a group definition acting as a template, with two keys specified as first name and last name. If the table is populated by two rows of attributes, it is acceptable for the values of last name to be the same, as long as the values for first name are different. In other words, the values "John Smith" and "Paul Smith" are acceptable instances of the two keys, but "John Smith" and "John Smith" are not.

A table definition must be defined after the group definition to which it refers. You can specify the same template for multiple table definitions, as long as each table definition has a different ID.


[Back] [Next]