Query commands

This table lists the specific authorities required for the query commands.

Command Referenced object Authority needed
For object For library
ANZQRY Query definition *USE *EXECUTE
CHGQRYA4      
CRTQMFORM Query management form: REPLACE(*NO)   *READ, *ADD, *EXECUTE
Query management form: REPLACE(*YES) *ALL *READ, *ADD, *EXECUTE
Source file *USE *EXECUTE
CRTQMQRY Query management query: REPLACE(*NO)   *READ, *ADD, *EXECUTE
Query management query: REPLACE(*YES) *ALL *READ, *ADD, *EXECUTE
Source file *USE *EXECUTE
OVRDBF command *USE *EXECUTE
DLTQMFORM Query management form OBJEXIST *EXECUTE
DLTQMQRY Query management query *OBJEXIST *EXECUTE
DLTQRY Query definition *OBJEXIST *EXECUTE
RTVQMFORM Query manager form *OBJEXIST *EXECUTE
Target source file *ALL *READ, *ADD, *EXECUTE
ADDPFM, CHGPFM, CLRPFM, CPYSRCF, CRTPRTF, CRTSRCPF, DLTF, DLTOVR, OVRDBF, RMVM commands *USE *EXECUTE
RTVQMQRY Query manager query *USE *EXECUTE
Target source file *ALL *READ, *ADD
ADDPFM, CHGPFM, CLRPFM, CPYSRCF, CRTPRTF, CRTSRCPF, DLTF, DLTOVR, OVRDBF, RMVM commands *USE *EXECUTE
RUNQRY Query definition *USE *USE
Input files *USE *EXECUTE
Output files Refer to the general rules. Refer to the general rules.
STRQMQRY 1 Query management query *USE *EXECUTE
Query management form, if specified *USE *EXECUTE
Query definition, if specified *USE *EXECUTE
Output file Refer to the general rules. Refer to the general rules.
ADDPFM, CHGOBJD, CHGPFM, CLRPFM, CPYSRCF, CRTPRTF, CRTSRCPF, DLTF, DLTOVR, GRTOBJAUT OVRDBF, OVRPRTF RMVM commands (if OUTPUT(*OUTFILE) is specified) *USE *EXECUTE
STRQMPRC 1 Source file containing query manager procedure *USE *EXECUTE
Source file containing command source file, if specified *USE *EXECUTE
OVRPRTF command, if statements result in printed report or query object. *USE *EXECUTE
STRQRY     *EXECUTE
WRKQMFORM 3 Query management form Any authority *USE
WRKQMQRY 3 Query management query Any authority *USE
WRKQRY 3      
1
To run STRQM, you must have the authority required by the statements in the query. For example, to insert a row in a table requires *OBJOPR, *ADD, and *EXECUTE authority to the table.
2
Ownership or some authority to the object is required.
3
To use individual operations, you must have the authority required by the individual operation.
4
To use the CHGQRYA command, you must have *JOBCTL special authority or be authorized to the SQL Administrator function of IBM i through Application Administration in IBM Navigator for i. The Change Function Usage Information (CHGFCNUSG) command, with a function ID of QIBM_DB_SQLADM, can also be used to change the list of authorized users.