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 during the creation of views, materialized query tables (MQTs), SQL routines, triggers, and packages that contain 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 and grant the privilege to the role. Then, grant the role to the user. See the related information section for details.

[{"Type":"MASTER","Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"ARM Category":[{"code":"a8m500000008PlOAAU","label":"Security and Plug-Ins-\u003EAuthorization and Privilege"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"10.1.0;10.5.0;11.1.0;11.5.0;9.7.0;9.8.0"}]

Document Information

Modified date:
24 July 2023

UID

swg21381783