AMT Help Files

Fields

The fields on a table can be edited as follows:  



 

The following properties are set on the Fields screen:

Properties

Description

Available Values

Name

Name of the field. <Text>

Type

Field type.

Note: An Integer (64 bit) and an Int32 (32 bit) will create a column in the database with the following types:

AMT MSSQL Oracle DB2
Int32 Integer NUMBER 9,0 Integer
Integer Numeric 18,0 NUMBER 18,0 Decimal 18,0

 

The Float Single and Float Double are ISO floating point types (IEEE 754) that can hold COMP-1 and COMP-2 variables respectively.
The length is fixed to 4 (bytes) for Single and 8 (bytes) for Double. Arrays are not allowed on floating point types.
The exact precision of these types depends on the database used, the following database field types will be used:

AMT MSSQL Oracle DB2
FloatSingle Float(24) BINARY_FLOAT REAL
FloatDouble Float(53) BINARY_DOUBLE DOUBLE

 

To insert fields inside a structure, create a Structure field and then select the END_STRUCTURE field. Inserting fields will then add the fields inside the structure.
Alternatively the Bulk Mode option can be used to place fields inside the structure.

<Alpha | Boolean | Financial |
Financial Comp | Float Double |
Float Single | Int32 | Integer |
Numeric | Numeric Comp | Signed | String | Structure | DbsDate | DbsDateTime | DbsTime >

Length

The maximum number of characters for the field, including any decimal positions. Not applicable for String, Integer or Boolean. With Database (Date)Time types this indicates the number of fractional seconds.

<Integer>

Decimals

Number of decimals for the field, which is included in the Length. <Integer>

Array

Array dimensions. Up to 6 dimensions can be specified, separated by commas.

Arrays are not allowed on floating point types.

<[Integer], [Integer], ..]>

Array stringfield

 

This would only need to be set to True if an array of type 'String' were to exceed its top boundary of 8096 bytes.

If this option is set to False and a String array value exceeds the 8096 bytes at runtime, then a SQL error will be returned.

<True>/<False>

Comment

 

Description of the field. <Text>
DbFieldType The database field type which is used in the application database.
Possible types depend on both the chosen AMT field type, length, decimals, dictionary and the database type specified in the generation set.
See the Database field types page for information on the usage and behaviour of this setting.

Please note that the developer is responsible for ensuring that the chosen AMT field fits in the chosen DbFieldType when selecting a DbFieldType different from the default type. 
 <Database specific field type>

See 'Database field types' for all possible options.

Encrypted

 

If set to True, the field values are stored encrypted in the runtime database.

If this option is changed, the database reorganization process encrypts/decrypts the field values.

Encryption has the following consequences:

  • If the encrypted field is part of an index, then the order for that index will be undefined. The index then only has use if it is referred to with the Equal function.
  • The actual size of the encrypted field (in the database) will be increased, to fit the encrypted value.

warning Warning: Fields used as Keys in Indexes should never be encrypted, because the database server will apply the index on the encrypted value leading to unexpected results.

warning Encryption for remote database access is not supported.

warning Database Date Time fields can not be encrypted.

<True>/<False>
Identity   

If identity is set, the field will automatically be filled with the next unique value when a new record is inserted.

The identity property can only be set to numeric field types. It is not possible to update the identity field.

It is not possible to have multiple identity-fields in one table. If a field is set as identity field, the build in AMT identity field LIONRECNO will be removed from the table.

<True>/<False>

Initial value

Default value that is assigned to the field.
To set an empty initial value (blank/spaces/empty string) for alphanumeric field types or an initial NULL value, right click on the 'InitialValue' property field.
This will display a pop-up with the options:

  • Clear initial value: This will clear any initial value set to this field.
  • Set empty initial value: Sets an empty initial value for alphanumeric field types, this will be displayed as '<Empty String>'.
    The column will be set to a default value of '' inside the database. 
  • Set null initial value: Sets a NULL initial value, this will be displayed as '<Null Value>'. 
    The column will be set to a default value of NULL inside the database when the database is being created.
  • Cancel: Closes the pop-up without any changes being applied.
<text>/<Empty String>/<Null Value>

NULL values

If set to True, it is possible to store NULL values in the field.

If set to False, it is not possible to store NULL values in the field.

Fields that belong to a table index are always set to False.

During the reorganization of the runtime database, AMT-COBOL makes sure that the database settings in this database are always according to the NULL Values property.

Please note that if a new field is added to a table containing data(rows) that does not allow NULL values, an initial value should also be set (see above), otherwise the reorganization process will fail. Alternatively it is possible to set the new field to allow NULL values initially and after a reorganization, to modify the field to disallow NULL values to be stored.

<True>/<False>