I'm running DB2 9.1.5 on the Z/os. I'm getting an unusual user privilege error running a stored procedure created as one user and run as another. Basically it goes like this:
* log in as USER111
* create procedure MAIN.PROC1 { procedure updates table MAIN.TABLE }
* log in as USER222
* call MAIN.PROC1()
SQL0551N "USER111" does not have the privilege to perform operation "UPDATE" on object "MAIN.TABLE". SQLSTATE=42501
This is correct. USER111 does not have update privileges, but USER222 does and that is who is logged in and running the procedure. Any idea on why I am getting this error?