Start of changeStart of change

-20474   PERMISSION OR MASK CANNOT BE CREATED FOR THE object-name OBJECT OF THE object-type TYPE. REASON CODE reason-code.

Explanation

The CREATE PERMISSION or CREATE MASK statement cannot be processed.

object-name
The name of the object.
object-type
The type of object.
reason-code
The reason for the message or SQL code, indicated by one of the following values:
1
The definition references the table for which the row permission or the column mask is being defined.
2
The definition references a table function.
3
The definition references a user-defined function that is not secure.
4
The definition references one of the following functions:
  • A function that is defined as not deterministic
  • A function that is defined to have an external action
  • A function that is defined with the MODIFIES SQL DATA option
5
The definition references an OLAP specification.
6
The definition references an XMLEXISTS predicate.
7
The definition references a ROW CHANGE expression.
8
The definition references a sequence reference.
9
The definition references a created or declared temporary table.
10
The definition references a table that was implicitly created for an XML column.
11
The definition references * or name.* in a SELECT clause.
12
The definition references a column that is defined with a FIELDPROC.
13
The definition references a language element that requires multiple encoding scheme processing.
14
The definition references an ordinary SQL identifier that contains a dash (-).
16
The body of a row permission or column mask includes a period specification.
17
One of the following situations occurred:
  • An attempt was made to create a row permission or column mask on one of the following table types:
    • A table that is defined with a period
    • A history table
    • An accelerator-only table
    You cannot create row permissions or column masks on these types of tables.
  • An attempt was made to implicitly create a default row permission for an ACTIVATE ROW ACCESS CONTROL specification.
32
The column for which the mask is defined was done so with a field procedure (FIELDPROC).
33
The data type of the return expression is not the same as the data type of the column on which the column mask is defined.
34
The length attribute of the return expression is not the same as the length attribute of the column on which the column mask is defined.
35
The null attribute of the return expression is not the same as the null attribute of the column on which the column mask is defined.
36
The subtype, encoding scheme, or CCSID of the return expression is not the same as the corresponding attribute of the column on which the column mask is defined.
37
An attribute of the return expression is not the same as the corresponding attribute of the column on which the column mask is defined. The attribute is not one of the attributes that are described in reason codes 33-36.
39
The definition references an accelerator-only table.
51
A row permission cannot be created for a table that has a security label column.
52
A row permission cannot reference a table that has a security label column.

System action

The statement cannot be processed.

Programmer response

Correct the syntax, and reissue the statement.

SQLSTATE

428HB

End of changeEnd of change