Tables

Use this function to create and modify database tables by defining their characteristics in the folder’s data dictionary. Once the definition is confirmed, the system creates or updates the corresponding table in the database.

Table management defines the list of database tables. You can also use activity codes to deactivate certain tables or indexes.

In addition to the structure of the table, the dictionary also defines:

  • Links to other tables (referential integrity). These links are used by cancellation utilities, import/export functions, and related tools.
  • Default information proposed when creating screens from these tables, such as help keywords, formatting, and so on.

Each table is identified by a name, in uppercase alphanumeric characters and starting with a letter, and an abbreviation. Custom or localized tables need to begin with X, Y, or Z.

Both the name and the abbreviation need to be unique within the database.

A table can be managed through an object, provided the necessary screens have been created.

Note - warningYou cannot add fields and specific or vertical characteristics to system or dictionary tables. These are not preserved during folder validation or migration.

Prerequisites

Refer to the implementation documentation.

Screen management

A table definition is defined in five tabs:

This tab defines basic identification information.

General tab

This tab defines general information regarding table behavior and system management.

Columns tab

Use this tab to define all the fields of the table through a drop-down menu.

In each table, it is possible to use fields whose names are standardized and which will automatically be updated by object management, if they exist. The fields are the following:

  • CREDAT and UPDDAT are respectively the creation and last update dates.
  • CRETIM and UPDTIM are respectively the creation and last update times.
  • CREUSR and UPDUSR are the user codes that performed the record creation and its last update.
  • EXPNUM is a sequential number used to timestamp the records for the import/export module, making it possible to export only the records that have been updated since the last export.
  • You can also add a sixth field to any table. This field, called ENAFLG, represents an active/inactive flag. If the table is managed by an object and a data type is associated with this field, the following controls are applied:
    • The standard selection window for the object, called by the selection key, automatically filters out inactive records.
    • An error message prevents direct entry of an inactive key code.

This does not apply when managing the object itself, as otherwise it would be impossible to reactivate records that were temporarily marked as inactive.

Index tab

Use this tab to define the different indexes created for the table.

Audit tab

Use this tab to configure the settings that allow insertions, deletions, and modifications performed on a table to be logged using automatically generated database triggers. When required, the values before and after the modification can be stored in dedicated fields.

Any record modification is logged as long as at least one of the field conditions is met.

This trace is stored in two specific tables: AUDITH and AUDITL. It can be viewed directly or can generate automated notifications through the Workflow.

The main principle is as follows:

  • As long as at least one audit flag (creation, modification, deletion) is selected, each operation of that type creates a line in the AUDITH table. This occurs regardless of whether field values are logged or whether their corresponding modification conditions are met.

  • As soon as fields are listed in the field grid, any modification to a field value that meets the specified condition triggers the creation of a line in AUDITL.

The trigger method makes it possible to log operations even when they are performed by a program other than Adonix.

The information in this tab is applied when the table is revalidated. Triggers are automatically created or modified at the same time.

The SUBTRIGGER processing contains the trigger description depending on the database.

The SPETRIGGER processing is used for specific developments to customize the trigger description.

The information in this tab is considered part of the setup. The standard does not deliver any audit setup. It is not necessary to protect modifications made in this tab using activity codes X, Y, or Z.

Audit behavior is globally controlled by the AUDIT activity code.

Following cannot be audited:

  • The audit tables themselves
  • fields of CLOB and BLOB type
  • Fields whose data type is AXX

The results of the audit can be viewed using following functions:

Limits to be respected

There are several constraints to consider when creating a table. The limits are as follows:

Concerning the key

  • Maximum of 15 indexes
  • Maximum of 16 fields per index
  • Maximum of 250 characters per index

Concerning the record

  • Maximum size of 32 KB under Oracle and SQL Server
  • Maximum of 255 fields per table
  • Maximum of 1,000 columns (calculated as field1 × dimension1 + field2 × dimension2 + … + fieldN × dimensionN)
  • Limit of either:
    • one BLOB or CLOB field of any size, or
    • several BLOB or CLOB fields, provided the total table size does not exceed 64 KB.

Number of open tables

  • Maximum of 255 open tables

Reports

By default, the following reports are associated with this function:

  • DICOX3: Table dictionary
  • ATABLIST: List of tables

This can be modified using a different setup.

Specific buttons

Options/Information

Displays an information box showing:

  • The number of fields in the table
  • The space used (in bytes) by one row, assuming all alphanumeric fields are filled
  • The number of rows currently present in the table
Options/Source

Displays the .srf file corresponding to the current table in the current application.

This option is useful on a server where the FIL directory is not accessible.

Options/Maintenance
Opens the maintenance function directly for this table.
Documentation/Paragraphs

Opens documentation management for the first documentation paragraph (if one exists) associated with the current record.

Documentation/Links

Opens link management for documentation.

This is used to define documentation‑specific relationships between the current record and other records (for example, the links between functions and parameters).

These links are used during the generation of documentation structures.

Documentation/Generation

Starts the documentation generation process.

You can also launch this action using the Generation button at the bottom of the screen.

You can generate one or all of the following simultaneously:

  • Documentation structure from the dictionary (ADOCUMENT, ADOCBLB, and ADOCCLB tables)
  • Documentation from the previous tables
  • Field documentation

The range suggested by default takes into account the current record, but you can modify it at launch time.

Error messages

In addition to the generic error messages, the following messages can appear during the entry:

The table contains no fields
A table has been created without defining at least one field.
The table does not contain a primary key
At least one index is required for every table.
The field title is not referenced
The title field entered in the first tab does not exist in the list of fields defined in the second tab.
Abbreviation exists already

Abbreviations must be unique in the folder.

This message appears when attempting to create a table using an abbreviation already used by another table.

A warning also appears if an existing table tries to use an abbreviation already defined for a view.

Unique abbreviations are recommended.

Prohibited character
The character " is not allowed in titles.
The field title is not referenced
A title entered in the General tab references a field not defined in the Fields tab.
Local menu number incorrect
This local menu number does not exist.
Incorrect length

The field length is incompatible with its internal type.

Allowed length rules:

  • Local menu: ≤ 30

  • Short integer: ≤ 4

  • Long integer: ≤ 8

  • Decimal: integer part + decimal part ≤ 32

  • Alphanumeric: ≤ 250

  • BLOB/CLOB: ≤ 20

The length value can also be incorrect if it is empty.

Incorrect option
You tried to enter an option that does not exist in the Option column associated with a field in the table.
Incorrect link expression
The link expression has a syntax error.
Index already entered
You tried to define the same index twice in a table.
Non-existent field
An index references a field that does not exist in the field list.
Dimensioned field
You tried to use a dimensioned field in an index, which is prohibited.
Number of columns too great
The table exceeds the limit of 1,000 columns, after applying dimensions.
Too many fields
The table exceeds the maximum of 255 fields. Dimensions do not count here.
Line length too great

The record size exceeds the allowed database limits:

  • SQL Server: 8,060 bytes

  • Oracle: No strict limit, but Adonix enforces 32 KB

Key too long
An index exceeds the maximum size of 256 characters.
Too many components in the key
A key contains more than 16 fields, which is the limit.
There are no translatable texts in this table
The Generation of translatable texts checkbox is selected, but the main table does not contain any field of AXX, AX1, AX2, or AX3 type.
Caution: This modification makes it necessary to change the Crystal reports linked to this table
Changing the Generation of translatable texts setting modifies how translated texts are printed in Crystal Reports. You need to update any reports using this table accordingly. Avoid modifying this option.
Other errors likely to appear

Additional errors can occur during table validation. They are displayed in a log file. Examples include:

  • Write error. For example, no disk space.
  • Oracle or SQL Server errors. The actual error message follows.

Tables used

Refer to the implementation documentation.