TO_OBJECT

functionsupportedCore SQL functions

docs.snowflake.com ↗

Conversion functionsSemi-structured and structured data functions

Converts the input value to an OBJECT: - For a VARIANT value containing an OBJECT, returns the OBJECT. - For NULL input, or for a VARIANT value containing only JSON null, returns NULL. - For an OBJECT, returns the OBJECT itself. - For all other input values, reports an error.

Syntax

TO_OBJECT( <expr> )

Parameters

NameRequiredDescription
exprrequiredAn expression that evaluates to a VARIANT that contains an OBJECT.

Returns

The data type of the returned value is OBJECT.