Class Hierarchy        Index

Class COM.cloudscape.database.ConsistencyChecker

java.lang.Object
   |
   +----COM.cloudscape.database.ConsistencyChecker

public class ConsistencyChecker
extends Object
Copyright © 1998-1999, Cloudscape, Inc. All rights reserved.

The ConsistencyChecker class provides static methods for verifying the consistency of the data stored within a database.

Use the methods of this class only within an SQL-J statement; do not call them directly.

Cloudscape reserves the right to change, rename, or remove this class or any of the the methods on the class at any time.


Constructor Index

 o ConsistencyChecker()

Method Index

 o checkTable(String, String)
Check the named table, ensuring that all of its indexes are consistent with the base heap.

Constructors

 o ConsistencyChecker
 public ConsistencyChecker()

Methods

 o checkTable
 public static boolean checkTable(String schemaName,
                                  String tableName) throws StandardException
Check the named table, ensuring that all of its indexes are consistent with the base heap. Use this method only within an SQL-J statement; do not call it directly.

When tables are consistent, the method returns true. Otherwise, the method throws an exception.

To check the consistency of a single table:

VALUES ConsistencyChecker.checkTable(SchemaName, TableName)

For example, to check the consistency of the table APP.Flights:

VALUES ConsistencyChecker.checkTable('APP', 'FLIGHTS')

To check the consistency of all of the tables in the 'APP' schema, stopping at the first failure:

SELECT tablename, ConsistencyChecker.checkTable(
'APP', tablename)
FROM sys.sysschemas s, sys.systables t WHERE s.schemaname = 'APP' AND s.schemaid = t.schemaid

To check the consistency of an entire database, stopping at the first failure:

SELECT schemaname, tablename,
ConsistencyChecker.checkTable(schemaname, tablename)
FROM sys.sysschemas s, sys.systables t
WHERE s.schemaid = t.schemaid

Parameters:
schemaName - The schema name of the table.
tableName - The name of the table
Returns:
true, if the table is consistent, exception thrown if inconsistent
Throws: StandardException
Thrown if some inconsistency is found, or if some unexpected exception is thrown..

  Class Hierarchy        Index