@Structure, @Fields, @Indexes
Only apply to table files (@Properties/Type : "Table").
@Structure
| Key | Description |
|---|---|
Name | Table name. Must start with a letter, letters/digits only, max 10 characters (DDS object name limit). |
Description | Table description. |
Also contains, nested: @Fields, @Indexes and optionally @Documentation (see @Documentation).
@Fields
One Name type(...) line per column:
@Fields {
CustCode char(6) Description("Customer code")
Name char(20) Description("Name")
Balance number(9,2) Default(0)
RegDate date
}
Allowed types: only char, number, date (not field/list/matrix — those are exclusive to @Variables, see Data types).
Modifiers:
| Modifier | Description |
|---|---|
Description("text") | Field description. Requires a quoted string. |
Default(value) | Default value: a quoted string or a bare number, depending on the field’s type. Not allowed on date fields. |
AllowNull | Allows NULL on this field. A PrimaryKey field can’t carry this modifier. |
@Indexes
One Kind(Name, [Fields...], "optional description") entry per access path:
@Indexes {
PrimaryKey ( GRIDDEMOPK, [CustCode] )
Unique ( GRIDDEMOEMAIL, [Email], "Unique email" )
Index ( GRIDDMNOM, [Name] )
}
| Kind | Description |
|---|---|
PrimaryKey | The table’s primary access path. Only one per table; its fields can’t be AllowNull. |
Unique | Unique secondary access path. |
Index | Non-unique secondary access path. |
Full example
@Properties {
Type : "Table"
}
@Structure {
Name : "GRIDDEMO"
Description : "Sample customers"
@Fields {
CustCode char(6) Description("Customer code")
Name char(20) Description("Name")
City char(15) Description("City")
}
@Indexes {
PrimaryKey ( GRIDDEMOPK, [CustCode] )
Index ( GRIDDMNOM, [Name] )
}
}