Dialog instructions / Editable record list (INPUT ARRAY) |
The INPUT ARRAY is a dialog instruct designed to browse and modify a list of record, binding a static or dynamic array model to a screen array of the current displayed form.
An INPUT ARRAY instruction supports additional features, built-in sort and search, multi-row selection and list modification triggers. For a detailed description of these features, see Table views.
Use the INPUT ARRAY instruction to let the end user update, delete and create new records in a list, after fetching a result set from the database. The result set is produced with a database cursor executing a SELECT statement. The SELECT SQL statement is usually completed at runtime with a WHERE clause produced from a CONSTRUCT dialog.
The INPUT ARRAY instruction associates a program array of records with a screen-array defined in a form so that the user can update the list of records. The INPUT ARRAY statement activates the current form (the form that was most recently displayed or the form in the current window. )
During the INPUT ARRAY execution, the user can edit or delete existing rows, insert new rows, and move inside the list of records. The program controls the behavior of the instruction with control blocks such as BEFORE DELETE, BEFORE INSERT, etc.
To terminate the INPUT ARRAY execution, the user can validate (or cancel) the dialog to commit (or invalidate) the modifications made in the list of records.
When the statement completes execution, the program must test the INT_FLAG variable to check if the dialog was validated (or canceled) and then use INSERT, DELETE, or UPDATE SQL statements to modify the appropriate database tables. The database can also be updated during the execution of theINPUT ARRAY statement.