IBM Support

SQLCODE: -551 or SQL0551N when user privileges are defined in a group

Troubleshooting


Problem

You try to create a view, materialized query tables (MQTs), SQL routine, trigger, or package that contains static SQL, and get error SQLCODE: -551 or SQL0551N.

Symptom


SQL0551N "<authorization-ID>" does not have the privilege to perform operation "<operation>" on object "<name>". SQLSTATE=42501

"<authorization-ID>" does not have the privilege to perform operation "<operation>" on object "<name>", SQLCODE=-551, SQLSTATE=42501

Cause


Privileges and authorities granted to groups are not considered when creating views, materialized query tables (MQTs), SQL routines, triggers, and packages containing static SQL. Avoid this restriction by using roles instead of groups.

Resolving The Problem

  • Grant the needed privileges to the user directly. See the related information section for details.

  • Create a role, grant the privilege to the role, grant the role to the user. See the related information section for details.

[{"Product":{"code":"SSEPGG","label":"DB2 for Linux- UNIX and Windows"},"Business Unit":{"code":"BU001","label":"Analytics Private Cloud"},"Component":"OTHER - Uncategorised","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.8;9.7;10.1;10.5;11.1","Edition":"Advanced Enterprise Server;Advanced Workgroup Server;Enterprise Server;Express;Express-C;Personal;Workgroup Server"}]

Document Information

Modified date:
16 June 2018

UID

swg21381783