Show TOC

Background documentationTable Operation Expression

 

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

Features

Supported Table Functions

The following table shows the different functions provided by the table operation expression for accessing table data objects:

Name

Comment

Has at least

Returns True if the specified table contains at least the given number of rows matching the given condition.

Has exactly

Returns True if the specified table contains exactly the given number of rows matching the given condition.

Has not exactly

Returns True if the specified table contains either more or less than the given number of rows matching the given condition.

Has less than

Returns True if the specified table contains less than the given number of rows matching the given condition.

Has more than

Returns True if the specified table contains more than the given number of rows matching the given condition.

Has no more than

Returns True if the specified table contains no more than the given number of rows matching the given condition.

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 Note

Unlike most other table operations, the Sort operation does not return a value. Rather, the sorting is done directly on the table data object specified in the expression context.

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 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.

End of the note.

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.