What it means
The program could not connect to Db2 because authorization failed. The message gives an error type and a Db2 reason code. Error types are user authorization, plan access, duplicate exit requested, installation error and connect. The statement is not run and no connection is made. SQLSTATE is 42505.
Except for the connect type, do not issue more SQL after a -922; the results are unpredictable. After a connect failure, the program is left unconnected and only CONNECT, COMMIT, ROLLBACK and local SET statements work.
Typical causes
- User authorization: the ID passed by the TSO, CICS, IMS or batch attachment is not valid for Db2.
- Plan access: the ID has no EXECUTE on the plan, or the plan does not exist.
- Installation error: a connection or sign-on exit rejected the request.
- Connect: a CONNECT ... USER ... USING failed, for example a wrong password.
- The job runs under a different user ID than the one the grants were made to.
How to fix it
- Note the error type and reason code; look the reason code up in the Db2 codes documentation.
- For plan access, check that the plan exists (SYSIBM.SYSPLAN) and that the ID has EXECUTE on it (SYSPLANAUTH).
- For user authorization or installation errors, give the details to the security or Db2 system programmer.
- For connect errors, check the user ID and password used in the CONNECT.
- Confirm which user ID the job or transaction actually ran under.
Example
Illustrative only; names and values are invented.
DSNT408I SQLCODE = -922, ERROR: AUTHORIZATION FAILURE: PLAN ACCESS ERROR.
REASON reason-code
DSNT418I SQLSTATE = 42505 SQLSTATE RETURN CODE