ALTER VIEW
Change an existing view.
Syntax-- Set a Column-Masking Policy
ALTER VIEW [ IF EXISTS ] <view_name>
MODIFY COLUMN <column_name>
SET MASKING POLICY <function_name> ( <column_name> [, ... ] )
-- Unset a Column-Masking Policy
ALTER VIEW [ IF EXISTS ] <view_name>
MODIFY COLUMN <column_name>
UNSET MASKING POLICY <function_name>
-- Add or Remove a Row-Access Policy
ALTER VIEW [ IF EXISTS ] <view_name>
{ ADD | DROP } ROW ACCESS POLICY <function_name> ( <column_name> [, ... ] )
Parameters
<view_name>
String
The path of the view that you want to create. The name of the view should be unique. The view can be in your home space.
MODIFY COLUMN <column_name>
String
Specifies the column to which the masking policy will apply and mask data for. The UDF serving as the masking policy must accept and return the same data type as the column it is masking.
<function_name>
String
Specifies the function to use with this security policy. If a function with this name does not exist, then the affected table/view will not be reachable until the policy is dropped or a UDF created.
Examples
Set a column-masking policy on multiple columnsALTER VIEW customers
MODIFY COLUMN ssn_col
SET MASKING POLICY protect_ssn (ssn_col, region)
ALTER VIEW customers
MODIFY COLUMN ssn_col
UNSET MASKING POLICY protect_ssn
ALTER VIEW customers
ADD ROW ACCESS POLICY state_policy ( state_col )
ALTER VIEW customers
DROP ROW ACCESS POLICY protect_ssn (ssn_col)
Was this page helpful?
Glad to hear it! Thank you for your feedback.
Sorry to hear that. Thank you for your feedback.