MSCEWI4057
Masking role must be defined previously by the user.
This is a deprecated version of the SnowConvert documentation, please visit the official site HERE.
Severity
Low
Description
This is EWI occurs when a MASKING POLICY is created and a role or privilege must be linked to it so the data masking could work properly.
Code Example
Input code
ALTER TABLE tableName
ALTER COLUMN columnName
ADD MASKED WITH (FUNCTION = 'partial(1, "xxxxx", 1)');
Output code:
/*** MSC-WARNING - MSCEWI4057 - MASKING ROLE MUST BE DEFINED PREVIOUSLY BY THE USER ***/
CREATE OR REPLACE MASKING POLICY "partial_1_xxxxx_1" AS
(val STRING)
RETURNS STRING ->
CASE
WHEN current_role() IN ('YOUR_DEFINED_ROLE_HERE')
THEN val
ELSE LEFT(val, 1) || 'xxxxx' || RIGHT(val, 1)
END;
Recommendations
If you need more support, you can email us at [email protected]
Last updated