J. Notes for Users of QUEL : QUEL Notes for the Writing 4GL Statements Chapter : Using All
 
Share this page                  
Using All
The reserved word all enables you to transfer values between the database and all the displayed fields of a form in a single statement. This multiple assignment applies to simple fields or table-field columns but does not include hidden fields or columns.
This QUEL example uses the retrieve statement with all the simple fields on a form. It retrieves data from the columns in the Personnel table into all the simple fields of the form Deptform.
deptform = retrieve (personnel.all)
  where personnel.empnum = 6;
Using All with the Retrieve Statement
This QUEL example fetches data into all the columns of a table field. The form name is optional.
deptform.tfield = retrieve
  (personnel.all)
4GL expands the reserved word all based on the list of displayed simple fields or table-field columns in the current form or the specified table field.
For each simple field or table-field column, the table must have a column in the table with the same name and a compatible data type. The table can have unmatched columns (more table columns than form fields or table-field columns), but cannot have unmatched fields or table-field columns.
Using All with the Replace Statement
The multiple assignment is also possible with a QUEL replace statement. This statement updates a row in the database table Personnel from all the simple fields in Deptform.
replace personnel (deptform.all)
  where personnel.idnum = idnum;
Using All with the Append Statement
Use all with the QUEL append statement. The following statement adds a new row to the table called Part from all the visible columns in row 3 of the Partstbl table field.
append part (partstbl[3].all);