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

SIZE

SIZE

Returns the size of the specified array or map.

Syntax

SIZE(value)
The following table describes the arguments for this command:
Argument
Required/Optional
Description
value
Required
Array or map data type. The array or map for which you want to determine the size.
If you specify an array, the function returns the number of elements in the array.
If you specify a map, the function returns the number of key-value pairs in the map.

Return Value

Int.
Returns -1 if the array or map is NULL.

Examples

The following expression returns the size of the array ITEM_NAME.
SIZE(ITEM_NAME)
ITEM_NAME
RETURN VALUE
[‘apples’,‘bananas’,‘oranges’]
3
[‘milk’,‘coffee’,‘tea’,‘chai’]
4
[‘cookie’,’cake’]
2
[‘croissant’,NULL]
2
NULL
-1
The following expression returns the size of the map SHIPMENT_DETAILS.
SIZE(SHIPMENT_DETAILS)
SHIPMENT_DETAILS
RETURN VALUE
[CA -> CNTR345, TX -> T234]
2
[AZ -> CNTR123, AL -> CNTR730, CA -> CNTR345]
3
[FL -> CNTR208, NULL]
2
NULL
-1

0 COMMENTS

We’d like to hear from you!