DML: Operators

Operators in DML expressions

Arithmetic operators

Concatenation operator

Boolean and comparison operators

Order of priority

Operators in DML expressions

DML expressions can contain three different categories of operators:

These operators are evaluated in a specific order of priority.

Note This topic does not describe how the operators handle the values null and absent.

Arithmetic operators

Use the arithmetic operators to calculate values. Because the Mapping Services Server can implicitly convert to the data classes Real number and Integer, you can use some non-numeric operands with arithmetic operators. The Data Class of the operands that you can use include:

  • Real numbers
  • Integers
  • Boolean
  • Date & Times

You can use different Classes of operands with any given arithmetic operator. For example, you could add a Date & Time to an Integer.

The following table summarizes the available arithmetic operators:

Operator Meaning

+

the plus sign adds two operands

-

the minus sign subtracts one operand from another

*

the asterisk character multiplies two operands

/

the slash character divides one operand into another

If you divide one Integer into another Integer, processing truncates any decimal numbers from the result: if the result is less than 1, then 0 is returned.

Concatenation operator

To concatenate two expressions, use the ampersand character ( & ). Because the Map Engine Server can implicitly convert to the Data Class String, you can use some non-string characters with the concatenation operator. You can concatenate any of the following data classes:

  • Boolean
  • Date & Time
  • Integer
  • Real number
  • String
  • Very Large Object

Concatenation limits

You can concatenate two V Data Class elements, but you cannot concatenate a V data class element with an element of another data class.

For example, you cannot concatenate a Very large object with a String.

Boolean and comparison operators

In if - then - else instructions and in Validation Rules, use:

  • Comparison operators to compare two expressions and return the value true or false
  • Boolean operators to combine or convert the return values of Boolean expressions and return the value true or false.

Compare two expressions

The data classes of the expressions that you can compare are:

Data class Data class
  • Boolean
  • Real number
  • Date & Time
  • String
  • Integer
  • Very large object

Because the Mapping Services Server can implicitly convert the data class of expressions, you can compare expressions that do not belong to the same data class. For example, the comparison expression true> 12.45 converts the Boolean expression true to the Real number 1 and returns false (1 is not greater than 12.45).

However, the Mapping Services Server cannot implicitly convert Very large objects. This means that you:

  • Can compare expressions that are Very large objects.
  • Cannot compare an expression that is a Very large object with an expression that belongs to another data class.

The following table summarizes the operators that you can use to compare the values that are returned by two expressions:

Operator The comparison returns true when...

>

The value on the left of this operator is greater than the value on the right.

<

The value on the left of this operator is less than the value on the right.

=

The values on both sides of this operator are equal.

<>

The values on both sides of this operator are not equal to one another.

>=

The value on the left of this operator is greater than or equal to the value on the right.

<=

The value on the left of this operator is less than or equal to the value on the right.

 

Combine or convert the return values of Boolean expressions

A Boolean expression is any expression that returns the value true or false. The following table summarizes the operators that you can use to:

  • Combine the return values of two Boolean expressions.
  • Convert the return value of a Boolean expression.
Operator Meaning

and

Compares two Boolean expressions and returns:

  • true when both expressions are true.
  • false when one or both expressions are false.

or

Compares two Boolean expressions and returns:

  • true when one or both of the Boolean expressions are true.
  • false when both of the Boolean expressions are false.

xor

Compares two Boolean expressions and returns:

  • true when only one expression is true (and the other is false).
  • false when both expressions are either true or false.

not

Converts a Boolean expression and returns:

  • true when the expression is false.
  • false when the expression is true.

Order of priority

Operators and other characters are evaluated in the following order of priority, from highest to lowest:

Order of priority Operator/Character

1

+ , - , not (plus and minus signs for Real and Integer numbers and not operator)

2

\ , \\ (backslash and double backslash, used in paths)

3

* , /

4

+, - (addition and subtraction operators)

5

< , <= , > , >=

6

= , <>

7

and

8

xor

9

or

10

:=

Related Links