Previous Topic: Value StatementNext Topic: ComponentID Group


Populating Tables

An array of group instances construct a table. The instances are rows of the table. Often, defining the group with a key is sufficient for defining the table, as the values of the attributes in each row are provided by the component. However, sometimes it is useful to provide the table's values in the .MIF file itself to define values in an attribute definition.

The table population mechanism separates the definition of the group from the data in the group. It uses a previously defined group as a template to store values into the MIF database.

The syntax to populate tables is as follows:

start table
	name = "table name"
	id = nnn
	class = "class string"
	{ v1[,v2 ...] }
	[ { vn[,vm ...] } ]
end table

A name statement must describe this table. The required id statement specifies an integer value unique across all other groups and tables in this component. The required class statement identifies the previously defined group that is being used as a template.

In a table row, the values are provided as previously shown, separated by commas and surrounded by the curly braces "{" and "}". The list of values is provided left-to-right in attribute-ID order; the value of the attribute with the lowest ID appearing first. If a value in the list is omitted, the corresponding attribute value, if defined in the template, is used as the "default" value. Omitting an attribute’s value when no default value is provided in the template is prohibited. Rows with too few commas are treated as rows with the requisite number of trailing commas, so the values specified in the template are used for the remaining attributes in the row.

Example: Populating a table using the group previously defined

start table
	Name = "Software Table"
	Class = "DMTF|Software Example|1"
	Id = 42
	{"Circus", "4.0a"}
	{"Disk Blaster", "2.0c"}
	{"Oleo", "3.0"}
	{"Presenter", "1.2"}
end table

In this example, the resulting table has four rows. The value statements in the group definition are used as default values during row population and not as a row themselves.

To populate rows without providing unique values for the combination of attributes that comprise the key is incorrect. Service Layers must reject a MIF that does not provide unique keys during row population.

A table definition must come after the group definition to which it refers. The group must have been specified with a key statement, and without an ID statement. More than one table can be created from a single template, but each table must have a different ID.