Record Types

A record type defines the structure of the record, including the name and datatype of each field in the record.

Here's an example of a record type:
[ string Symbol; | integer Shares; float Price; ]
The type describes a record with three fields: a string field called Symbol, which is the sole key field because it is to the left of the | symbol; an integer field representing the number of shares; and a float field representing the price.

Each field must have one of the basic datatypes (integer, long, float, money, money(n), string, date, bigdatetime, timestamp, interval, binary, or boolean). Records cannot be nested.

Because record types are long, it is often helpful to use typedef to give them a shorter name:
typedef [ string Symbol; | integer Shares; float Price; ] rec_t;
The typedef in this example creates a record with three fields (the same as in the first example) and gives it the name rec_t.