TO_ARRAY

functionsupportedCore SQL functions

docs.snowflake.com ↗

Conversion functionsSemi-structured and structured data functions

Converts the input expression to an ARRAY value.

Syntax

TO_ARRAY( <expr> )

Parameters

NameRequiredDescription
exprrequiredAn 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