The SYSCS_UTIL.SYSCS_INVALIDATE_STORED_STATEMENTS system procedure invalidates all stored prepared statements (that is, all statements in the SYSSTATEMENTS system table).
The next time one of the invalid stored prepared statements in the SYSSTATEMENTS system table is executed, it will be recompiled, and a new plan will be generated for it.
Run SYSCS_UTIL.SYSCS_INVALIDATE_STORED_STATEMENTS whenever you think that your metadata queries or triggers are misbehaving -- for example, if they throw java.lang.NoSuchMethodError or java.lang.NoSuchMethodException on execution. Derby stores plans for triggers and metadata queries in the database. These should be invalidated automatically on upgrade and at other necessary times. Should you encounter an instance where they are not, you have found a bug that you should report, but one that you can likely work around by running SYSCS_UTIL.SYSCS_INVALIDATE_STORED_STATEMENTS.
SYSCS_UTIL.SYSCS_INVALIDATE_STORED_STATEMENTS()
No result is returned by this procedure.
If authentication and SQL authorization are both enabled, only the database owner has execute privileges on this procedure by default. See "Enabling user authentication" and "Setting the SQL standard authorization mode" in the Derby Developer's Guide for more information. The database owner can grant access to other users.
CallableStatement cs = conn.prepareCall ("CALL SYSCS_UTIL.SYSCS_INVALIDATE_STORED_STATEMENTS()"); cs.execute(); cs.close();
CALL SYSCS_UTIL.SYSCS_INVALIDATE_STORED_STATEMENTS();