apache > db
Apache DB Project
 
Font size:      

The SYSCS_CHECK_TABLE function

The SYSCS_CHECK_TABLE function

The SYSCS_UTIL.SYSCS_CHECK_TABLE() checks the consistency of a Derby table. You run this function in an SQL statement, as follows:

VALUES SYSCS_UTIL.SYSCS_CHECK_TABLE(
    SchemaName, TableName)

SYSCS_CHECK_TABLE returns a smallint. If the table is consistent (or if SYSCS_CHECK_TABLE is run on a view), SYSCS_CHECK_TABLE returns a non-zero value. Otherwise, SYSCS_CHECK_TABLE throws an exception on the first inconsistency it finds.

SYSCS_UTIL.SYSCS_CHECK_TABLE verifies the following:

  • Base tables are internally consistent.
  • Base tables and all associated indexes contain the same number of rows.
  • The values and row locations in each index match those of the base table.
  • All BTREE indexes are internally consistent.
Note:
Both SchemaName and TableName must be any expression that evaluates to a string data type. If you created a schema or table name as a non-delimited identifier, you must present their names in all upper case. For example:
VALUES SYSCS_UTIL.SYSCS_CHECK_TABLE('APP', 'CITIES')

For a consistent table, the following result is displayed:

1
-----
1
 
1 row selected

Previous Page
Next Page
Table of Contents
Index