ALTER MASK RULE

Description

The ALTER MASK RULE syntax is used to create a mask rule.

Syntax

Grammar Railroad diagram

  1. AlterEncryptRule ::=
  2. 'ALTER' 'MASK' 'RULE' maskRuleDefinition (',' maskRuleDefinition)*
  3. maskRuleDefinition ::=
  4. ruleName '(' 'COLUMNS' '(' columnDefinition (',' columnDefinition)* ')' ')'
  5. columnDefinition ::=
  6. '(' 'NAME' '=' columnName ',' maskAlgorithmDefinition ')'
  7. maskAlgorithmDefinition ::=
  8. 'TYPE' '(' 'NAME' '=' maskAlgorithmType (',' propertiesDefinition)? ')'
  9. propertiesDefinition ::=
  10. 'PROPERTIES' '(' key '=' value (',' key '=' value)* ')'
  11. ruleName ::=
  12. identifier
  13. columnName ::=
  14. identifier
  15. maskAlgorithmType ::=
  16. literal
  17. key ::=
  18. string
  19. value ::=
  20. literal

Supplement

Example

Alter a mask rule

  1. ALTER MASK RULE t_mask (
  2. COLUMNS(
  3. (NAME=phone_number,TYPE(NAME='MASK_FROM_X_TO_Y', PROPERTIES("from-x"=1, "to-y"=2, "replace-char"="*"))),
  4. (NAME=address,TYPE(NAME='MD5'))
  5. ));

Reserved words

ALTER, MASK, RULE, COLUMNS, NAME, TYPE