-20478 THE STATEMENT CANNOT BE PROCESSED BECAUSE COLUMN MASK mask-name (DEFINED FOR COLUMN column-name) EXISTS AND THE COLUMN MASK CANNOT BE APPLIED OR THE DEFINITION OF THE MASK CONFLICTS WITH THE REQUESTED STATEMENT. REASON CODE reason-code.

Explanation

The statement could not be processed because of a conflict with a column mask that is defined on a column.

mask-name
The name of the column mask.
column-name
The name of the column.
reason-code
The reason for the message or SQL code, indicated by one of the following values:
1
The result table of the select is derived from a set operation that involves one of the following set operators:
  • EXCEPT ALL
  • EXCEPT DISTINCT
  • INTERSECT ALL
  • INTERSECT DISTINCT
2
The column is referenced in the select list of the scalar fullselect and the result of the scalar fullselect expression is derived from one of the following set operators:
  • EXCEPT ALL
  • EXCEPT DISTINCT
  • INTERSECT ALL
  • INTERSECT DISTINCT
20
The result table is derived from a recursive common table expression and the column is specified in the fullselect of the recursive common table expression.
21
A column in the select list is an INCLUDE column for a data change statement that is derived from the column for which the mask is defined. The column mask cannot be applied in this context.
22
The result table is derived from a table function and the column was specified as an input argument to the table function.
23
A column in the select list is derived from an OLAP specification and the column is referenced in the partitioning expression or sort key expression of the OLAP specification.
24
The column is referenced in a WHEN clause of a CASE expression.
27
A sort key expression for ARRAY_AGG, LISTAGG, PERCENTILE_CONT, PERCENTILE_DISC or MEDIAN references a column for which a column mask is defined.
30
An insert or update operation uses a masked value that is returned from the mask and column that are identified in the message, and the expression that is specified in the THEN or ELSE clause of the column mask definition is not a simple reference to the column.

When the object table is column access control activated, for an insert or update operation, the return expression in the column mask definition must be a simple reference to the column for which the mask is defined.

31
The query includes a GROUPING SETS, CUBE or ROLLUP clause.

System action

The statement cannot be processed.

Programmer response

Check the application compatibility value that is used by your application to ensure that it is set properly. The behavior of the statement might change based on the application compatibility level.

Take the action that corresponds to the reason-code value, and reissue the statement.

1
Either do not reference the column in the select list or do not use the set operation in this context.
2
Either do not reference the column in the select list of the scalar-fullselect expression or do not use a set operator to derive the result of the scalar-fullselect expression in this context.
20
Either remove the reference to the column of the recursive common table expression from the select list or do not use the recursive common table expression in this context.
21
Either remove the INCLUDE column from the select list or do not derive the INCLUDE column from the column name.
22
Either do not reference the table function or do not specify the column as input to the table function.
23
Either do not reference the column in the OLAP expression or do not use the OLAP expression in this context.
24
Either change the query to remove the reference to the column in the CASE expression or do not reference the CASE expression in this context.
30
Either change the statement to remove the reference to the column in the insert or update operation, or contact the security administrator to ask them to deactivate the column access control from the object table or modify the return expression in the column mask definition.
31
Remove the GROUPING SETS, CUBE or ROLLUP clause from the query.

SQLSTATE

428HD