%Test meta-SQL element

Syntax

%Test(Prefix, Test, Suffix)

Description

The %Test construct can be used with records that have no key values.

Parameters

Parameter Description

Prefix

Specify a string that is conditionally added before the expansion of the test string. You cannot use meta-SQL in this parameter.

Test

Specify a meta-SQL string to be expanded.

Suffix

Specify a string that is conditionally added at the end of the test string. You can use meta-SQL in this parameter.

Returns

If the expansion of Test produces only a blank (or empty) string, the entire %Test meta-SQL construct is replaced with an empty string. Otherwise, the %Test meta-SQL construct is replaced by the prefix, then the expansion of Test, and then the suffix.

Example

The following meta-SQL generates valid SQL even when the given record has no keys:

%SelectAll(:1) %Test(WHERE ,%KeyEqual(:1));