#

# LogiView

## Where Clauses with Comparison Operators

| This syntax may be used for the definition of a LogiView variable database access and as an argument for 'where', 'where_ent', and 'where_ent2' commands.
| ### ### Syntax:
| {STR_EXPR}{WHR_CMP}{EXPR}
{STR_EXPR} | String expression with the name of a table field in the form 'table name.column name'. |
{WHR_CMP}
| Comparison operator:
> | greater
< | smaller than
= | equal to
<> | not equal to
>= | greater or equal to
<= | smaller or equal to
{EXPR} | Expression of the comparison value analog to the type of table field. |
| ### ### Example 1: WHERE clauses with numerical expression as comparison value
| Definition of a selection condition as argument of a 'where' command (part of the combined select instruction):
    where("MAT.MAX_WIDTH" >= 5*CON1)
| Result:
| All records of the "MAT" table are selected, whose "MAX_WIDTH" field contents is greater then or equal to the expression '5*CON1' ("CON1" is a variable or constant of type integer or float).
| ### ### Example 2: WHERE clauses with string expression as comparison value
| Assignment to integer variable NR by using the 'sel_value' function in the action part of a decision table:
    NR=sel_value("Mat.ID_NO","MAT.NAME"="maho-%")
| Result:
| The NR integer variable is defined with the contents of the "ID_NO" field from a record in the WRK database table. The "NAME" string field of the selected record matches the pattern 'maho-%', i.e. a string of arbitrary size starting with "maho-". If more than one record exists matching this Where clause, a selection menu with all matches is displayed.
| ### ### Example 3: WHERE clauses with logical expression as comparison value
| Definition of the database access for the float variable F1 (in the variable declaration table):
Name | T | ... | Database access | ...
F1 | I | ... | "WRK.MAX_Y", "WRK.STANDARD" = TRUE | ...
| Result:
| Using the float variable F1, you may access the "MAX_Y" (float) field of those records in the "WRK" database table, whose "STANDARD" (logic) field contains the value TRUE.
| The value TRUE is represented by a in DataView lists.