Database field types
The DbFieldType property adds the possibility to control the data type used for that field/column of the table in the application database.
For each AMT database field type, a default database field type will be displayed. This default value depends on the type, length and decimals properties of the field, as well as the database kind set in the generation set of the application and finally the DbFieldType application option setting located in the database section of the application options.
Besides the default value, other database data types can be selected in the drop down menu of the DbFieldType property. The possible data types available differs between AMT field types and the set database kind in the generation set.
See the tables below for the default values and available data types for a MSSQL, Oracle or DB2 database kind.
Please note that the developer is responsible to ensure that the chosen AMT field fits in the chosen DbFieldType when selecting a DbFieldType different from the default type. |
The DbFieldType property value will change to the default value after changing one of the following field properties: Type, Length or Decimals. This behaviour can be changed by setting the DbFieldType application option to manual. Which causes the DbFieldType property to only revert to the default value after the field property Type is changed.
Default MSSQL database field types.
If UNICODE is enabled, the Unicode version (N...) of the field type will be used if available. E.g. NVARCHAR.
AMT field type | Condition | Default DB field type | All DB field type options |
Alpha | Length <= 5 | CHAR / NCHAR | CHAR, VARCHAR, NCHAR, NVARCHAR, TEXT, NTEXT, VARCHAR(MAX), NVARCHAR(MAX) |
Length > 5 and <= 8000 | VARCHAR / NVARCHAR * | ||
Length > 8000 | VARCHAR(MAX) / NVARCHAR(MAX) * | ||
Boolean | - | CHAR / NCHAR | CHAR, VARCHAR, NCHAR, NVARCHAR, TEXT, NTEXT, VARCHAR(MAX), NVARCHAR(MAX) |
Financial, Numeric, Signed |
Length <= 9 & zero decimals | INT | NUMERIC, INT, BIGINT |
Length > 9 and/or decimals >0 | NUMERIC | ||
Float Double | - | FLOAT(53) | FLOAT(53) |
Float Single | - | FLOAT(24) | FLOAT(24) |
Int32 | - | INT | INT, NUMERIC |
Integer | - | NUMERIC | BIGINT, NUMERIC |
String | - | VARCHAR(MAX) / NVARCHAR(MAX) | TEXT, NTEXT, VARCHAR(MAX), NVARCHAR(MAX) |
DbsDate | - | DATE | DATE |
DbsDateTime | - | DATETIME2 | DATETIME2 |
DbsTime | - | TIME | TIME |
*) The default type of normal sized Alpha fields and big Alpha fields can be changed on the Application options > Database section if the Database field type setting is set to Manual.
Default Oracle database field types.
If UNICODE is enabled, the Unicode version (N...) of the field type will be used if available. E.g. NCLOB.
AMT field type | Condition | Default DB field type | All DB field type options |
Alpha | Length <= 4000 ( <= 2000 when UNICODE) | VARCHAR2 / NVARCHAR2 | CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, NCLOB |
Length > 4000 ( > 2000 when UNICODE) | CLOB / NCLOB | ||
Boolean | - | VARCHAR2 / NVARCHAR2 | CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, NCLOB |
Financial, Numeric, Signed |
Length <= 9 & zero decimals | NUMERIC(9) (INT) | NUMERIC, NUMERIC(9) (INT), NUMERIC(18) (BIGINT) |
Length > 9 and/or decimals >0 | NUMERIC | ||
Float Double | - | BINARY_DOUBLE | BINARY_DOUBLE |
Float Single | - | BINARY_FLOAT | BINARY_FLOAT |
Int32 | - | NUMERIC(9) (INT) |
NUMERIC(9) (INT), NUMERIC |
Integer | - | NUMERIC | NUMERIC(18) (BIGINT), NUMERIC |
String | - | CLOB, NCLOB | CLOB, NCLOB |
DbsDate | - | DATE | DATE |
DbsDateTime | - | TIMESTAMP | TIMESTAMP |
DbsTime | - | TIMESTAMP | TIMESTAMP |
Default DB2 database field types.
AMT field type | Condition | Default DB field type | All DB field type options |
Alpha | Length <= 17 | CHAR | CHAR, VARCHAR, CLOB |
Length > 17 and <= 8000 | VARCHAR * | ||
Length > 8000 | CLOB | ||
Boolean | - | CHAR | CHAR, VARCHAR, CLOB |
Financial, Numeric, Signed |
Length <= 9 & zero decimals | INTEGER | NUMERIC, INTEGER, BIGINT |
Length > 9 and/or decimals >0 | NUMERIC | ||
Float Double | - | DOUBLE | DOUBLE |
Float Single | - | REAL | REAL |
Int32 | - | INTEGER | INTEGER, NUMERIC |
Integer | - | NUMERIC | BIGINT, NUMERIC |
String | - | CLOB | CLOB |
DbsDate | - | DATE | DATE |
DbsDateTime | - | TIMESTAMP | TIMESTAMP |
DbsTime | - | TIME | TIME, TIMESTAMP |
*) The default type of normal sized Alpha fields can be changed on the Application options > Database section if the Database field type setting is set to Manual.