Use comparison operators to compare string or numeric strings, manipulate data, and return a TRUE (1) or FALSE (0) value.

The following table lists the transformation language comparison operators:

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 field

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, Data Integration returns NULL.

You can use the equal to (=) and not equal to (!=) operators to compare two arrays or two structs.

Two arrays are equivalent if the following conditions are true:

- •The array elements are the same data type.
- •The arrays are the same size.
- •The element at each index is the same.

For example, you have the following arrays:

A = [1, 2, 3]

B = [1, 2, 3]

B = [1, 2, 3]

You can make the following comparison:

A = B

Both arrays contain integers, the arrays are the same size, and the element at each index is the same such that A[0]=B[0], A[1]=B[1], and A[2]=B[2]. The return value is TRUE (1).

Two structs are equivalent if the following conditions are true for the corresponding struct elements:

- •The elements are the same data type.
- •The elements hold the same data.

For example, you have the following structs:

struct1 {

name:'Paul'

zip:10004

}

struct2 {

firstname:'Paul'

zip1:10004

}

name:'Paul'

zip:10004

}

struct2 {

firstname:'Paul'

zip1:10004

}

You can make the following comparison:

struct1 = struct2

The corresponding elements are the same data type and hold the same data, so the return value is TRUE (1).

© Copyright Informatica LLC 2007, 2021