CHECK TABLE

From Lianjapedia
Jump to: navigation, search

Purpose

Checks the integrity of a table and its indexes and memo file.

Syntax

CHECK TABLE [REPAIR]

See Also

ADATABASES(), ADD TABLE, ALTER INDEX, ALTER TABLE, CHECK DATABASE, CLOSE DATABASES, CLOSE TABLES, COMPILE DATABASE, COPY DATABASE, CREATE DATABASE, CREATE INDEX, CREATE TABLE, CREATE VIEW, DATABASE(), DBUSED(), DISPLAY DATABASE, DISPLAY INDEXES, DISPLAY SCHEMAS, DISPLAY TABLES, DROP DATABASE, DROP INDEX, DROP TABLE, GETENV(), INDEX, LIST DATABASE, LIST INDEXES, LIST SCHEMAS, LIST TABLES, OPEN DATABASE, PACK, PACK DATABASE, REBUILD DATABASE, REINDEX DATABASE, SET AUTOCATALOG, SET EXCLUSIVE, USE

Description

The CHECK TABLE command checks the integrity of a table and its indexes and memo file, where applicable.

If the optional REPAIR keyword is specified:

  • Any detected index errors are auto repaired.
  • Any detected duplicate links in the memo file are unlinked.

The CHECK TABLE command can be run on shared data.

After execution the "_tally" system variable is set to the number of errors detected.

Example

open database southwind
check table customers
if _tally > 0
  check table customers repair
endif