Designer 10.7 | webMethods Service Development Help | Conditional Expressions | Operators for Use in Conditional Expressions | Relational Operators | Standard Relational Operators
 
Standard Relational Operators
You can use the standard relational operators to compare the contents of a variable with any type of value (such as numerical, string, Boolean, dates) or another variable. When comparing strings using the standard operators, Integration Server uses a binary code point comparison algorithm. In this algorithm, Integration Server compares each byte in the first string with each byte in the second string to determine which string is numerically greater. For example, “A” has a value of 65 and “a” has a value of 97, so “a” is greater than “A”. Keep the following points in mind when using standard relational operators to compare strings:
*Integration Server considers A to be the lowest letter and Z to be the highest (for example, A < B, A < Z, B > A, Z > A).
*Integration Server considers lowercase letters to be greater than the matching uppercase letter (for example, a > A, A < a, a < B, c > A).
*If you use a standard relational operator to compare numbers in fields of type String, Integration Server treats the contents in the field as numbers. To stop Integration Server from treating the value as a number or to force a string-based comparison, use the lexical relational operators such as "L_EQUALS". For more information about lexical operators, see Lexical Relational Operators .
The following table identifies the standard relational operators you can use in expressions and filters.
Operator
Syntax
Description
=
a = b
Equal to.
This example...
Evaluates to true if...
customerID = "webMethods"
The value of the customerId variable is “webMethods.”
==
a == b
Equal to.
This example...
Evaluates to true if...
sku == "WM001"
The value of the sku variable is “WM001.”
!=
a != b
Not equal to.
This example...
Evaluates to true if...
quantity != 0
The value of the quantity variable does not equal 0 (zero).
<>
a <> b
Not equal to.
This example...
Evaluates to true if...
state <> 'ME'
The value of the state variable does not equal ME (Maine).
>
a > b
Greater than.
This example...
Evaluates to true if...
price > 100
The value of the price variable is greater than 100.
%companyID% > "Acme"
The value of the companyID variable is greater than Acme.
>=
a >= b
Greater than or equal to.
This example...
Evaluates to true if...
%totalPrice% >= 100
The value of the totalPrice variable is greater than or equal to 100.
companyID >= "Acme"
The value of the companyID variable is greater than or equal to Acme.
<
a < b
Less than.
This example...
Evaluates to true if...
quantity < 5
The value of the quantity variable is less than 5.
companyID < "Acme"
The value of the companyID variable is less than Acme.
<=
a <= b
Less than or equal to.
This example...
Evaluates to true if...
unitPrice <= 100
The value of the unitPrice variable is less than or equal to 100.
companyID <= "Acme"
The value of the companyID variable is less than or equal to Acme.
Related Topics
Lexical Relational Operators
Logical Operators