Column Element

This is the major element in the table definition file and each one describes a column in the database table. It has several attributes:-

name

This assigns the column name and is required.

null

This needs to be assigned "true", null="true" if the value in this column can be null. The default value is "false" if the attribute is missing.

type

This defines the type of the column. The default is "VARCHAR", which defines the column data to be text.

size

This defines the size of the entry. The default is one, which if the type is the default value of "VARCHAR" sets the columnd to hold a maximum of 1 text character.

Warning

This should be set to a larger value, since otherwise input text to the column will be silently truncated.

primary_key

This needs to be assigned "true", primary_key="true" if the value in this column is the primary key for the table. The default value is "false" if the attribute is missing.

Warning

Only one column should be the primary key

auto_increment

This needs to be assigned "true", if the value in this column is automatically incremented as new entries are inserted into the table.

no_spaces
This can be assigned "true", if whitespace is to be removed from the text strings stored in this column. The default is "false".

The "Column" element can contain the following optional elements

Description

Text describing the column.

uniqueID

This text is used to identify the column to the software. The value in here may be embedded in the text, so that this value allows the software to identify the column despite the name being user definable. It became apparent that the code would be improved if their was a mechanism to allow columns to be identified. This is what I cam up with.

value

This element allows the contents of the column to be specifed as one of several predefined values, e.g. "user", "lecturer" or "manager". Each value element defines one of the values, so several of these elements are expected. One of the defined value elements can have a "default" attribute set to "true" to define the corresponding value as the default value for a column entry.

autoNumber

This emtpy element defines the column content has being a number automatically defined by the database.

sequence

The presence of this empty element is used by the table editing software to identify that this column entries can be assigned values automatically in a sequential fashion. This is used to link table entries in the question list table automatically via the followingQu column.