Row selection criteria in freeform style
To enter freeform row selection criteria, you use the Row Selection
Criteria entry field at the top of the Column Selection/Edit panel.
The entry field is protected and you cannot update it if:
- It already contains a WHERE clause which was generated by column, or
- You have used the TEDIT command to display the Column Selection/Edit panel
In this entry field, enter any valid SQL WHERE clause to specify selection criteria to select the data you want to view or edit.
For example, if you have two columns, WORKDEPT and LASTNAME, and you want
to display only details of people in department A00 whose family name starts
in the range A
to M
:
- Enter the following selection criteria:
WORKDEPT = 'A00' AND LASTNAME BETWEEN 'A%' AND 'M%'
Alternatively, you can use the FM/Db2 reference numbers as abbreviations for the column names. For example, you can write the preceding expression as:#5 = 'A00' AND #4 BETWEEN 'A%' AND 'M%'
If you use abbreviations for column names, FM/Db2 expands them to the full column name when you press Enter. If you omit the keyword WHERE, FM/Db2 inserts it when you press Enter.
The Column Selection/Edit panel now looks like this: - Press the Exit function key (F3).
FM/Db2 displays the selected rows:
Related tasks
- Using the SQL Edit session
- Scrolling the Row Selection Criteria field
- Expanding the Row Selection Criteria field
Related references