Column Data Types
[Previous] [Main] [Next]

Turbo Database offers the following types of table columns:

String
A string field holds alphanumeric characters up to the given limit. The maximum size is 255 characters. A string field holds one byte for each character plus one byte for the length of the string.

Byte
Numbers from 0 to 255. Byte fields can have an optional null indicator. The size is one or two bytes depending on the null indicator.

SmallInt
Numbers from -32767 to +32768. SmallInt fields can have an optional null indicator. The size is two or three bytes.

Integer
Numbers from -2147483648 to +2147483647. Integer fields can have an optional null indicator. It takes four or five bytes in the database table.

Double
Holds a 8 byte floating number, i.e. from 5.0e-324 to 1.7 x 10e308. Can have an optional null indicator. The size is eight or nine bytes.

Time
Values from 12:00 am to 11:59 pm. Can have an optional null indicator. Size is two or three bytes.

Date
Values from 1/1/0000 to 12/31/9999. Size is four bytes. Internally dates are represented as a packed bit field.

DateTime
Values from 1/1/0000 12:00 am to 12/31/9999 11:59 pm. Values take eight bytes internally.

Boolean
Holds a boolen value: True or False. Can have an optional null indicator. Size is one or two bytes.

Enumeration
Holds one of a definable set of named values, e.g. mon,tue,wed,thu,fri,sam,sun. The values have to be valid identifiers similar to column names. They can be converted to textual representation using the function Str. Example for a enumeration field gender with values male,female,unknown: When the value female has been assigned Str(gender) returns the string 'female' while gender by itself returns the number 2. The null value of an enumeration field is represented by the number 0 and the empty string.

Memo
Long strings of variable length (no limit). Memos are stored in an additional file that has the name as the file for the database table but the extension is mmo.

Blob
Images and other binary data of variable length. Blobs are are stored in an additional file that has the name as the file for the database table but the extension is blb.

Link
Pointer to another record in the same or another table (1:n relation). The target table is fixed for all link values of this column. Links are explained in "The Concept of Automatic Linking". A link field contains the record id of the record the field is linked to. Its size is four bytes.

Relation
Pointer list to other records in the same or another table (m:n relation). The target table is fixed for all link values of this column. Relations are explained in "The Concept of Automatic Linking". Relations fields are not real fields in the database table itself. There is an additional database table created transparently for each relation field that holds one link per row. The relation table has two link column one of which points to the database table that has the relation field and the other one points to the database table the relation field links to. Such the relation field itself has a size of zero bytes.

AutoInc
Counter that gives a unique number to each record. AutoInc fields are assigned its values by the database engine and can not be edited. The Automatic Data Link mechanism uses AutoInc fields as the primary index to store record references.