Granting EXECUTE privilege for iSeries

You can use the built-in stored procedure QSYS.QCMDEXC(). to grant the EXECUTE privilege for iSeries libraries.

If the built-in stored procedure QSYS.QCMDEXC() is registered on the target server, QMF finds it at runtime and invokes it either explicitly when QMF generates SQL DDL scripts during installation, or implicitly when binding static packages or creating stored procedures depending upon the selected protection method, stored procedures or static SQL packages.

If the built-in stored procedure QSYS.QCMDEXC() is not registered on the target server, then QMF does not invoke it at all. However, the libraries RSBI, Q, RDBI, and the library where QMF stored procedures or static SQL packages are created may not be granted the proper privileges. In this case, the database administrator must perform the following grant privilege operations for iSeries libraries:
  • GRTOBJAUT OBJ(RSBI) OBJTYPE(*LIB) USER(*PUBLIC) AUT(*EXECUTE);
  • GRTOBJAUT OBJ(Q) OBJTYPE(*LIB) USER(*PUBLIC) AUT(*EXECUTE);
  • GRTOBJAUT OBJ(RDBI) OBJTYPE(*LIB) USER(*PUBLIC) AUT(*EXECUTE);
  • GRTOBJAUT OBJ(QFWPKG) OBJTYPE(*LIB) USER(*PUBLIC) AUT(*EXECUTE);
where QFWPKG is the library of QMF stored procedures or static SQL packages.