· Jul 15, 2022

Dynamic SQL giving security error

I get this on preparing a sql query


ERROR #5580: SQL Privilege Violation: 'User UnknownUser is not privileged for the operation'

There was some embedded sql queries before that which worked fine however.

Discussion (2)0
Log in or sign up to continue

You can review the 'UnknownUser' user's permissions. In the documentation it says that 'Embedded SQL' does not check permissions:

InterSystems SQL enforces privilege checking for ODBC, JDBC, Dynamic SQL, and the SQL Shell interface on InterSystems IRIS data platform. Embedded SQL statements do not perform privilege checking;

Or use an authenticated user with the proper permissions;

About privileges and users: Users, Roles, and Privileges

About authentication: Authentication and Authorization