REQUIRE.SELECT

REQUIRE.SELECT

Top  Previous  Next

 

The REQUIRE.SELECT keyword indicates that the query should only proceed if there is an active select list.

 

 

Format

 

REQUIRE.SELECT

 

 

The REQUIRE.SELECT keyword is useful in automated queries from paragraphs, etc. where a preceding SELECT might have found no items and hence not left an active list. The following query would therefore process all records instead of none.

 

If no select list is active when a query using this keyword is initiated, an error message is displayed.

 

 

Example

 

SELECT ORDERS WITH VALUE > 1000 SAVING UNIQUE CUST.NO

0 records selected to list 0

LIST CUSTOMERS REQUIRE.SELECT

Select list required - Processing terminated

 

The above sequence shows how the REQUIRE.SELECT keyword causes the query processor to terminate the LIST operation when no records were found matching the selection criteria. Without this keyword, the LIST would have reported all the customers.