String Operators

The concatenation operator ( : or CAT) links string expressions to form compound string expressions, as follows:

'HELLO.  ' : 'MY NAME IS ' : X : ".  WHAT'S YOURS?"

or:

'HELLO.  ' CAT 'MY NAME IS ' CAT X CAT ".  WHAT'S 
YOURS?"

If, for instance, the current value of X is JANE, these string expressions both have the following value:

 "HELLO.  MY NAME IS JANE.  WHAT'S YOURS?"

Multiple concatenation operations are performed from left to right. Parenthetical expressions are evaluated before operations outside the parentheses.

With the exception of the null value, all operands in concatenated expressions are considered to be string values, regardless of whether they are string or numeric expressions. However, the precedence of arithmetic operators is higher than the concatenation operator. For example:

 "THERE ARE " : "2" + "2" : "3" : " WINDOWS."

has the value:

 "THERE ARE 43 WINDOWS."

The result of any string operation involving the null value is the null value. Since the null value represents an unknown value, the results of operations on that value are also unknown. But if the null value is referenced as a character string containing only the null value (that is, as the string CHAR(128) ), it is treated as character string data. For example, the following expression evaluates to null:

"A" : @NULL

But this expression evaluates to "A<CHAR128>":

"A" : @NULL.STR