Andromeda defines columns differently than you might expect if you are used to hand-coding CREATE TABLE commands. This section explains how this works.
In regular SQL, a CREATE TABLE command contains the complete description of each column, including the type and, if required, the precision and scale. The major conceptual drawback to regular SQL is that a programmer can deliberately use the same column name in different tables for columns with different types, precisions and scales. This is in itself confusing and can only lead to confusion in code.
In Andromeda a column name is used only once to define a column, and that column is then placed into one or more tables. This ensures that the columns of the same name are always exactly the same in all tables.
Columns are defined as top-level elements. That means that column definitions have an indent level of zero. Here is an example column definition:
column example:
description: A Numeric Value
type_id: numb
colprec: 10
colscale: 5
The basic column definition has these properties:
The table be
| Type | colprec | colscale | Notes |
|---|---|---|---|
| char | Required | ignored | Equivalent to SQL type 'char' |
| vchar | Required | ignored | Equivalent to SQL type 'varchar' |
| int | ignored | ignored | Equivalent to SQL type 'int' |
| numb | Required | Required | Equivalent to SQL type 'numeric' |
| text | ignored | ignored | Equivalent to SQL type 'text' or 'clob' |
| cbool | ignored | ignored | "Character Boolean", accepts Y or N |
| gender | ignored | ignored | Accepts M, F, or U |
| date | ignored | ignored | A date-only field (no time) |
| time | ignored | ignored | A number from 0-1440, minutes since midnight. |
| datetime | ignored | ignored | Called either 'timestamp' or 'datetime' on various platforms. |
| money | ignored | ignored | Shortcut for numb(14,2) |