TO_ARRAY
functionsupportedCore SQL functionsConverts the input expression to an ARRAY value.
Syntax
TO_ARRAY( <expr> )
Parameters
| Name | Required | Description |
|---|---|---|
expr | required | An expression of any data type. |
Returns
This function returns a value of type ARRAY or NULL: - If the input is an ARRAY, or a VARIANT containing an ARRAY value, the value is returned unchanged. - If expr is a NULL or JSON null value, the function returns NULL. - For any other value, the value returned is a single-element array that contains this value.
Usage notes
- To create an array that contains more than one element, you can use ARRAY_CONSTRUCT or STRTOK_TO_ARRAY.