SYSTEM$ADD_REFERENCE
functionsupportedNative apps, listings & sharingCalled by a Snowflake Native App to associate a consumer reference string to a reference definition. The app can use this association to access the consumer object. The reference string passed to this system function is the value returned by the SYSTEM$REFERENCE function, which represents a consumer object. For information about using this function in an app, see Request references and object-level privileges from consumers. This function supports both single-valued and multi-valued references. For a single-valued reference, the function returns an error if an association already exists. To replace that association, use SYSTEM$SET_REFERENCE.
Syntax
SYSTEM$ADD_REFERENCE('<reference_name>', '<reference_string>')
Parameters
| Name | Required | Description |
|---|---|---|
'reference_name' | required | The name of the reference as specified in the manifest.yml file of the app. |
'reference_string' | required | The system-generated ID of the reference to the object in the consumer account. |
Returns
Returns a VARCHAR value that contains the system-generated alias for the new association. For a multi-valued reference, pass this alias to SYSTEM$REMOVE_REFERENCE or SYSTEM$GET_REFERENCED_OBJECT_ID_HASH to identify a single association.