Categories:

Context Functions (Session Object)

INVOKER_SHARE

Returns the share name if the query is called from the data sharing consumer and null if the query is called from the provider account user.

Use the INVOKER_SHARE function to differentiate between a data sharing consumer account and the provider account user, or to apply different masking policies to different shares.

In this Topic:

Syntax

INVOKER_SHARE()

Arguments

None.

Usage Notes

When a query is run by a user in a data sharing consumer account, the masking policy applied to columns at the data sharing provider gets executed.

Examples

This policy expression example provides a partially masked value for all data sharing consumers, unmasked value for users in the data sharing provider with primary session role of PII_ROLE, and a fully masked value for everyone else.

case
  when invoker_share() is not null then partial_mask(val)
  when current_role() in ('PII_ROLE') then val
  else '***-**-****'
end;

This policy expression example applies different masking methods to different shares, where a custom entitlement table determines which masking method to use for a data sharing consumer account.

case
  when invoker_share() in SHARE1 then mask1_function(val)
  when invoker_share() in SHARE2 then mask2_function(val)
  when current_role() in PII_ROLE then val
  else '***-**-****'
end;