Schema Properties

The schema of a table is an ordered collection of columns. Most of the properties relating to the schema of a table are defined by the IliSchema class, from which the IliTable class inherits. However, the “mapping” properties are defined by the IliTable class. Each column in a schema has the following properties:

Identification

  • Index — Indicates the position of the column within the schema (starting from 0). Note that the index of a column may change when other columns are inserted or removed from the schema.

  • Name — Allows other components of the Data Access library (such as data-source-aware gadgets) to refer to a column by its name.

  • Token — Is a “magic cookie” (an IlInt) that is assigned to the column at creation time. It is guaranteed to remain constant even across program executions and is unique among all the columns that belong to a given schema. It is used mostly by subclasses of the IliTable class that need to identify columns independently of name or index changes. This property is not accessible from within Views Studio.

Column Type

  • Datatype — Specifies the data type of all values in this column.

  • Maximum Length — Applies only when the data type of the column assumes values of varying size (typically, the IliStringType data type).

  • Nullable — Specifies whether a column allows null values or not.

  • Part Of Key — Specifies whether the column belongs to the primary key of the table or not. The primary key of a schema is a subset of the columns such that the table will reject any update or insertion that would result in the table having two rows whose values are equal over the columns belonging to the primary key. In other words, the primary key is a set of columns that can serve to identify rows in the table uniquely.

  • Default Value — Indicates a value that will be displayed when the user inserts a new row in the table.

Look

  • Format — Specifies the format that will be used to display values. See the IliFormat class.

  • Mask — Specifies the mask used to enter values. See the IliInputMask class.

  • Alignment — Specifies how values in this column will be displayed. Usually, character string values are left-aligned and date and numeric values are right-aligned.

  • Display Width — Indicates the width in pixels of the column when it is displayed.

  • Visibility — Indicates whether a column is visible to the end users. Note that in this case the column and the values it contains can still be accessed by the API.

  • Title — Specifies the caption of the column when it is displayed in a table gadget. By default, the name of the column is used.

  • Label — Is the caption of the column when it is displayed in a DbField gadget. By default, the name of the column is used.

  • Read Only — Specifies whether the column is read-only.

For more information on how the look of a column applies to gadgets that are connected to it, see Setting the Table Look.

Mapping

A column can be mapped onto a column that belongs to another table. This table is referred to as the foreign table. See Foreign Tables. In this situation, when the column is displayed, the value shown is not the original column value. Instead, a value from the foreign table is displayed. The foreign table is therefore used as if it were a dictionary. In addition, the user can modify the column value by selecting a value from a pull-down menu that contains a list of possible values. The foreign table provides the domain of values for the column.

The properties relating to the mapping of a column are defined by the IliTable class.

There are two ways in which a foreign table can be defined: either the name of a data source or the name of a table object can be specified. The latter is an API-only option.

  • Foreign Data Source Name — Specifies the name of the data source from which the foreign table is obtained.

  • Foreign Table — Indicates the foreign table (this property is not accessible from within Views Studio).

  • Value Column — Indicates the name of the column in the foreign table that defines the domain.

  • Display Column — Indicates the name of the column in the foreign table that will be displayed in place of the original column value.

  • Constrained — Indicates whether the column rejects any values that do not belong to the value column of the foreign table.

  • Completion — Indicates whether any incomplete user input will be automatically completed by the gadget on validation, when the column is being edited in a table combo box.