IBM i: SQL0204 deleting recently created table
[DB2/400 iSeries AS/400 -204]
Symptom
A table is created and deleted within the same procedure, for example the use of a temporary (e.g. /BI0/…) table in a BW query. The table is created and used successfully but at the end of the procedure, when it is to be deleted, the delete fails with an SQL0204 “Table not found” error.
Other terms
DB2/400 iSeries AS/400 -204
Reason and Prerequisites
The problem is caused by a corrupted pointer in an SQL package, which is something that happens very rarely and for which the root cause could not be found, up to now. This causes the delete to be attempted for the wrong system name and leads to the error.
Solution
Delete the affected SQL package if the system gives enough information for it to be identified. If the individual package cannot be identified, then the solution is to run DLTR3PKG and delete all SQL packages for the system. The system should be brought down in this case, before the packages are deleted.