INVOKER_SHARE
functionsupportedNative apps, listings & sharingReturns the name of the share that directly accessed the table or view where the INVOKER_SHARE function is invoked, otherwise the function returns NULL.
Syntax
INVOKER_SHARE()
Usage notes
- If using the INVOKER_SHARE function with masking policy, verify that your Snowflake account is Enterprise Edition or higher.
- Use the INVOKER_SHARE function in a policy that is attached to a table or view that is directly invoked by a share.
- If the INVOKER_SHARE function is used inside a User-defined functions overview within a masking policy directly attached to a table or view, INVOKER_SHARE returns NULL because the context of the INVOKER_SHARE function is the UDF owner, not the share.
- To help determine if a table or view was directly or indirectly invoked by a share, consider using the CURRENT_ACCOUNT function in a masking policy. This function returns the Snowflake account for the user’s current session, which can help determine if the table or view is invoked from a data sharing consumer account.