DataTable part
An EGL dataTable part is primarily composed of these components:
- A structure, with each top-level item defining a column.
- An array of values that are consistent with those columns. Each element of that array defines a row.
A data table of error messages, for example, might include these components:
- The declaration of a numeric field and a character field
- A list of paired values like these—
001 Error 1 002 Error 2 003 Error 3
You do not declare a data table as if you were declaring a record or data item. Instead, any code that can access a table part can treat that part as a variable. For details on part access, see References to parts.
Any code that can access a table part has the option of referencing the part name in a Use declaration.
Types of data tables
Some types of data tables are for run-time validation; specifically, to hold data for comparison against form input. (You relate the data table to the input field when you declare the form part.) Three types of validation data tables are available:
- matchValidTable
- The user's input must match a value in the first data-table column.
- matchInvalidTable
- The user's input must be different from any value in the first data-table column.
- rangeChkTable
- The user's input must match a value that is between the values in the first and second column of at least one data-table row. (The range is inclusive; the user's input is valid if it matches a value in the first or second column of any row.)
The other types of data tables are as follows:
- msgTable
- Contains run-time messages.
- basicTable
- Contains other information that is used in the program logic; for example, a list of countries and related codes.
Data-table generation
The output of data-table generation is a pair of files, each named for the data table. One file has the extension .java, the other has the extension .tab. The .tab file is not processed by the Java compiler, but is included in the root of the directory structure that contains the package. If the package is my.product.package, for example, the directory structure is my/product/package, and the .tab file is in the directory that contains the subdirectory my.
You do not need to generate data tables if you are generating into a package to which you had previously generated the same data tables.
To save generation time when you do not need to generate data tables, assign NO to the build descriptor option genTables.
Properties of the data table
You can set the following properties:
- An alias is incorporated into the names of generated output. If you do not specify an alias, the part name is used instead.
- The shared property indicates whether multiple users can access the data table. The default is no.
- The resident property indicates whether the data table remains in memory even when no program is using the data table. (The program goes into memory when first accessed.) The default is no. You can specify yes only if the shared specification is also yes.
Related concepts
References to parts
Related reference
Use declaration