Data Masking policy error on shared database

Viewed 144

I am trying to apply data masking policy on shared database where we have access to only views.However I provided grant to databases also.I am not able to apply this masking policy

here is my code

create or replace masking policy Policy_name as (val string) returns string ->
case
when current_role() in ('SECURITYADMIN') then val
else '*********'
end;

alter table if exists TABLE_NAME modify column PHN_NUMBER set MASKING POLICY Policy_name PHN_NUMBER;

error:

SQL execution error: Creating masking_policy on shared database 'DATABASE_NAME' is not allowed.
1 Answers

the limitation of DATA MASKING section says you cannot do this.

A data sharing consumer cannot apply a masking policy to a shared database or table. As a workaround, import the shared database or table and apply the masking policy to a local view on that shared table column.

Related