OBJECT_INSERT

functionsupportedCore SQL functions

docs.snowflake.com ↗

Semi-structured and structured data functions

Returns an OBJECT value consisting of the input OBJECT value with a new key-value pair inserted (or an existing key updated with a new value).

Syntax

supportedpartialnot supportednot scored

OBJECT_INSERT( <object> , <key> , <value> [ , <updateFlag> ] )

Parameters

NameRequiredDescription
objectrequiredThe source OBJECT value into which the new key-value pair is inserted or in which an existing key-value pair is updated.
keyrequiredThe new key to be inserted into the OBJECT value or an existing key whose value is being updated. The specified key must be different from all existing keys in the OBJECT value, unless updateFlag is set to TRUE.
valuerequiredThe value associated with the key.
updateFlagoptionalA Boolean flag that, when set to TRUE, specifies that the input value updates the value of an existing key in the OBJECT value, rather than inserting a new key-value pair. The default is FALSE.

Returns

This function returns a value that has the OBJECT data type.

Usage notes