Logical expressions for SQL records

The following table shows the typical elements in logical expressions that use SQL records:

Table 1. Logical expressions for SQL records
First operand Comparison Operator Second operand
field in SQL record One of these:
  • is
  • not
One of these:
blanks
Non-SQL-specific keyword for testing whether the value of a character variable is or is not blanks only
numeric
Non-SQL-specific keyword for testing whether the value of a character variable (except DBCHAR type) is or is not numeric
trunc
Keyword for testing whether non-blank characters were deleted on the right when a single- or double-byte character value was last read from a relational database into the field

The trunc test can resolve to true only when the database column is longer than the field. The value for the test is false after a value is moved to the field or after the field is set to null.

field in SQL record One of these:
  • ==
  • !=
NULL. Keyword for testing whether the field was set to a null value, either by an assignment statement or by reading from a relational database


Feedback