Search view
The Search view consists of a single scrollable area which shows all available fields for the database table specified in the Retrieval component.
To include a field in the Search criteria, drag the desired field tile above the text header Drag fields above this line. Once dragging is complete, the field name tile will display its four component parts:
The Search Key
replaces the Comparison Operator / Comparison Value pair with a single text string that encapsulates both the Operator and the Value. This string must be either hard-coded in the Comparison Value field, or formatted in the Procedure before commencing the DB retrieval and passed to the Comparison Value field in a variable. If this variable is also used as a Parameter, then at run-time this Parameter will be represented as a pair of pop-up lists with valid Comparison Operators and editable text field for entering the Comparison value.
Grouping of the search criteria
When multiple search fields are combined into one group, they are treated as cumulatively narrowing search - i.e. all search conditions must be met in order for the retrieved row to be returned to the calling procedure. In other words, they are treated on the "AND" basis, as in the following example:
Here, the row would be returned (included in the list of matching rows) if "Freight" was greater than 100, AND "OrderDate" was before January 1, 2004, AND "RequiredDate" was before January 15, 2004.
Sometimes the search criteria need to be more flexible. Scribe provides a mechanism that allows flexible grouping of various search conditions by enclosing selected groups of search conditions into parentheses, and grouping them together through AND and OR operators. E.g., if the above example had to be formulated as "return rows that have "Freight" value greater than 100, AND either the "OrderDate" before January 1, 2004 OR "RequiredDate" before January 15, 2004, the search criteria could be formatted as follows:
with AND, OR, "(" and ")" operators dragged from the Palette.