Table of Contents

Search

  1. Preface
  2. The Transformation Language
  3. Constants
  4. Operators
  5. Variables
  6. Dates
  7. Functions

Transformation Language Reference

Transformation Language Reference

Comparison Operators

Comparison Operators

Use comparison operators to compare character or numeric strings, manipulate data, and return a TRUE (1) or FALSE (0) value.
The following table lists the comparison operators in the transformation language:
Operator
Meaning
=
Equal to.
>
Greater than.
<
Less than.
>=
Greater than or equal to.
<=
Less than or equal to.
<>
Not equal to.
!=
Not equal to.
^=
Not equal to.
Use the greater than (>) and less than (<) operators to compare numeric values or return a range of rows based on the sort order for a primary key in a particular port.
When you use comparison operators in an expression, the operands must be the same datatype. For example, the expression 123.4 > ‘123’ is not valid because the expression compares a decimal with a string. The expressions 123.4 > 123 and ‘a’ != ‘b’ are valid because the operands are the same datatype.
If you compare a value to a null value, the result is NULL.
If a filter condition evaluates to NULL, the Integration Service returns NULL.

Comparing Complex Data Types

You can use the equal to (=) and not equal to (!=) operators to compare complex data types such as arrays or structs.
For two arrays to be equivalent, the following conditions must apply:
  • The array elements must be of the same data type.
  • The arrays must be the same size.
  • The entry at each index must be the same.
For example, you have the following arrays:
A = [1, 2, 3] B = [1, 2, 3]
You can make the following comparison:
A = B
RETURN VALUE
: TRUE (1)
Both arrays are the same size and the entry at each index is the same such that
A[0]=B[0], A[1]=B[1], and A[2]=B[2]
.
When you compare two structs, the structs are equivalent if they meet the following conditions:
  • The corresponding struct elements must be of the same data type.
  • The structs must have the same data.
If these conditions are satisfied, the two structs are equivalent even if the struct elements have different names.
For example, you have the following structs:
struct1 { name:'Paul' zip:10004 } struct2 { firstname:'Paul' zip1:10004 }
You can make the following comparison:
struct1 = struct2
RETURN VALUE
: TRUE (1)

0 COMMENTS

We’d like to hear from you!