The table operation expression provides numerous functions for accessing and maintaining the data stored in a BRFplus data object of type table.
With this expression type, you can carry out a number of different administrative tasks as well as retrieve statistical data about a table data object. The available features resemble those offered by the aggregation and existence check modes of the DB lookup expression, but the scope is slightly different. The following table aims at clarifying the differences between the two expression types:
Criterion |
Table Operation |
DB Lookup |
---|---|---|
Context data object |
BRFplus table data object |
DDIC table |
Usage |
Business-oriented approach |
Database-oriented approach |
Access style |
read/write (various delete operations available) |
read only |
The following table shows the different functions provided by the table operation expression for accessing table data objects:
Name |
Comment |
---|---|
Has at least |
Returns |
Has exactly |
Returns |
Has not exactly |
Returns |
Has less than |
Returns |
Has more than |
Returns |
Has no more than |
Returns |
Count |
Returns the number of rows matching the given condition in the specified table. |
Minimum |
Returns the lowest value found in the specified table column matching the given condition. |
Maximum |
Returns the highest value found in the specified table column matching the given condition. |
Total |
Returns the total of all values found in the specified table column matching the given condition. |
Average |
Returns the average of all values found in the specified table column matching the given condition. |
First line |
Returns the first row matching the given condition in the specified table. |
Last line |
Returns the last row matching the given condition in the specified table. |
All lines |
Returns all rows matching the given condition in the specified table. |
Sort |
Sorts the rows of the specified table by the values in the given columns and sort order. Note Unlike most other table operations, the The sorting result is kept in memory only and not permanently stored in the database. You can sort a table by a maximum of five different columns. End of the note. |
Delete first line |
Removes the first row in the specified table matching the given condition. The changed table (without the removed row) is returned as the result. |
Delete last line |
Removes the last row matching the given condition in the specified table. The changed table (without the removed row) is returned as the result. |
Delete all lines |
Removes all rows matching the given condition in the specified table. The changed table (without the removed rows) is returned as the result. |
Note
For all operations, it is also possible not to provide a selection condition. In that case, the operation is applied to all the rows in the specified table.
Of the operations listed above, the following can only be used together with a numeric table field:
Minimum
Maximum
Total
Average
The BRFplus workbench supports you in finding the appropriate columns of a given table by only offering those fields that match the requirements of a particular operation.