Trying to run an EXPLAIN gives this error message:
EXPLAIN STATEMENT '
SELECT * FROM EMPNET.EMPLOYEE
' INTO TABLE EMPNET.AP;
*+ Status = -4 SQLSTATE = 42603 Messages follow:
*+ DB002025 T50 C-4M6003: Tables not allowed, Schema:EMPNET
*+ DB001903 T50 C-4M6021: ACCESS_PLAN table creation error
Release: All supported releases.
There are three types of SQL schema in IDMS.
SQL defined entities can only be placed in a type R schema. The output of an EXPLAIN statement is a native SQL table and as such it must be directed to a type R schema.
The DB002025 message means you are trying to direct the output of an EXPLAIN statement to a schema of one of the other types, most likely N.
Change the INTO TABLE clause of the EXPLAIN statement to reference a native SQL schema (type R).
For example:
EXPLAIN STATEMENT '
SELECT * FROM EMPNET.EMPLOYEE
' INTO TABLE SQLSCHM.AP;
where SQLSCHM is defined thus:
CREATE SCHEMA SQLSCHM
DEFAULT AREA SQLWORK.SQL-AREA-1
;
The following SQL statement can be used to list all of your schemas and their types:
SELECT NAME, TYPE FROM SYSTEM.SCHEMA;