Was this helpful?
validrow Statement--Check Column Validity
This statement performs a validation check on columns in a specified row of the table field.
Syntax
validrow formname tablename [row]
    [(columnname {, columnname})]
Description
The validrow statement validates the columns in a specified displayed row of the table field. (For a full description of validation checks, see Table Fields.) If a column fails a check, Ingres displays an error message, the application breaks out of the operation currently in progress, and the cursor is positioned on the first invalid column.
If all indicated columns pass the validation check, execution continues with the next statement. Only a row's displayed columns can be validated. (Hidden columns are not validated.) The validrow statement must be used within a display loop.
When you execute the validrow statement, the FRS performs the validation check immediately, independent of any user action. This is in contrast to the set_frs statement, which directs the FRS to perform the check when the user performs some specified action, such as pressing the Menu key.
The formname is the name of the form in which the table field tablename is displayed. You can specify formname and tablename using quoted or unquoted character string literals or program variables.
The row is the number of the displayed row to be validated. Row can be either an integer literal or an integer program variable. The row must be in the range from 1 to the number of displayed rows for the table field as specified in VIFRED. If row is omitted, the row on which the screen cursor currently rests is validated.
The columnnames identify the columns to be validated in the specified row. You can specify a columnname as a character string, with or without quotes, or as a program variable. Only the columns listed are validated. If you omit the column list, the FRS validates all columns.
If you want to validate all displayed rows in a table field, use the validate statement.
Examples--validrow statement:
Example 1:
Validate all displayed columns of the current row, before issuing a getrow statement.
exec frs validrow empform employee;
 exec frs getrow empform employee 
    (:ename = ename, :age = age, :eno = eno);
Example 2:
Validate the sal and age columns of the first displayed row before retrieving the values. Neither of these columns is hidden.
exec frs validrow empform employee 1 (age, sal);
 exec frs getrow empform employee 1
    (:age = age, :sal = sal, :state = _state);
Last modified date: 08/14/2024