inittable Statement--Initialize a Table Field
A table field becomes associated with a data set when it is initialized. The initialization, which must occur after the form has been declared to the FRS, sets up the structure of the underlying data set; it does not actually put any data into the data set. The inittable statement initializes a table field..
This statement has the following syntax:
inittable formname tablename [tablemode]
[(columnname = format {, columnname = format})];
formname
Specifies the name of the form in which the table field tablename is displayed
tablemode
Specifies one of the display modes described in
Table Field Display Modes (read, update, query or fill). The default mode is fill.
You can optionally include hidden columns in the table field by enumerating them in the inittable statement. Hidden columns are identical to other table field columns, except that they are not displayed in the table field and therefore are invisible to the runtime user. The program can access values in hidden columns, just as it can access values in displayed columns. A typical use for a hidden column is as a repository for the unique identifying information (such as the employee number for an employee) of each row that is loaded into the data set from a database table. Once the user has modified the rows in the table field, the program can use the hidden column values within a search condition to update rows of the database table.
Unlike other columns in the table field, which are defined in Visual Forms Editor, hidden columns are defined when the table field is initialized.
columnname
Specifies the name by which the hidden column in the column list for inittable can be accessed
format
Indicates its storage format. The format must be a legal Ingres SQL data type from the following list.
See the SQL Reference Guide for details about these data types.
The optional clauses with null and not null can follow the data type specification. By default, hidden columns are set to not null.
For example, the following embedded SQL statement sets up two hidden fields:
exec frs inittable empform employee update
(sal = float4, eno = integer);
This defines a data set for the employee table field in the empform form. The table field is in update mode and contains two hidden columns, sal and eno. The table field also has the displayed columns defined for it in Visual Forms Editor; these are ename and age, with the titles Name and Age, as shown in the preceding figure.
Last modified date: 04/03/2024