The SYSCS_UTIL.SYSCS_CHECK_TABLE function checks the specified table, ensuring that all of its indexes are consistent with the base table. If the table and indexes are consistent, the method returns a SMALLINT with value 1. If the table and indexes are inconsistent, the function will throw an exception.
SMALLINT SYSCS_UTIL.SYSCS_CHECK_TABLE(IN SCHEMANAME VARCHAR(128), IN TABLENAME VARCHAR(128))
An error will occur if either SCHEMANAME or TABLENAME are null.
If authentication and SQL authorization are both enabled, only the database owner has execute privileges on this function 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.
Check a single table:
VALUES SYSCS_UTIL.SYSCS_CHECK_TABLE('SALES', 'ORDERS');
Check all tables:
SELECT schemaname, tablename, SYSCS_UTIL.SYSCS_CHECK_TABLE(schemaname, tablename) FROM sys.sysschemas s, sys.systables t WHERE s.schemaid = t.schemaid;