Troubleshooting
Problem
Symptom
You may see this information on the execution of your SQL, either in the joblog showing a SQL0462 or the database monitor showing a SQLCode (QQI8) of +462 and a SQLState (QQC81) of 01548, etc.
Note that this is a positive SQLCode, which is a warning, and not a failure.
Cause
Some of these IBM created SQL Views have calls within their logic to IBM created user-defined table functions.
These IBM created user-defined table functions may return a SQLCode +462 with a SQLState of 01548 if that IBM created user-defined table function touches a schema (etc.) that the user associated with the execution of that query does not have access to.
In this case, no data is returned for that schema (etc.) - as it is not applicable - and the query continues on.
This SQLCode is not necessarily stating that the authority issue is directly related to the query.
To clarify with an example, refer to this query:
SELECT 'A' INTO :hv1
FROM QSYS2.SYSSCHEMAS
WHERE SYSTEM_SCHEMA_NAME = '<YOURLIB>'
This may return a SQLCode +462 but the CURRENT USER *does* have authority to schema <YOURLIB>.
So why the SQLCode of +462?
SQL View QSYS2.SYSSCHEMAS is calling user-defined table function OBJECT_STATISTICS and that is (attempting) to access more schemas that just '<YOURLIB>'.
The CURRENT USER does not have enough authority to one (or more) of those schemas.
Since this query does not need any information from those schemas, a (warning) SQLCode of +462 is returned and the query continues on.
You will usually only see this SQLCode when you are running with a CURRENT USER with authority to only a subset of the IBM i schemas (etc.)
The SQLState of 01548 is also referenced in this V7R2 URL
http://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_75/rzajq/rzajqudfobjectstat.htm?lang=en
which describes the OBJECT_STATISTICS table function in more detail
Diagnosing The Problem
Message . . . . : Procedure or user-defined function OBJECT_STATISTICS in QSYS2 returned a warning SQLSTATE.
Resolving The Problem
Another option is to run that query with a CURRENT USER that has authority to all schemas (etc.) on they system.
Historical Number
N1012655
Was this topic helpful?
Document Information
More support for:
IBM i
Component:
IBM i Db2->SQL Services / table functions
Software version:
All Version(s)
Operating system(s):
IBM i
Document number:
687139
Modified date:
28 November 2024
UID
nas8N1012655