Contents IndexUPDATE (positioned) statement WHENEVER statement

User's Guide
   Part VI. SQL Anywhere Reference
     Chapter 43. Watcom-SQL Statements
      VALIDATE TABLE statement

Function

To validate a table in the database.

Syntax

     VALIDATE TABLE [ owner.]table-name

Usage

Anywhere.

Permissions

Must be the owner of the table or have DBA authority or have REMOTE DBA authority (SQL Remote).

Side effects

None.

See also

Description

The VALIDATE TABLE statement will scan every row of a table and look each row up in each index on the table. If the database file is corrupt, an error will be reported. This should not happen. However, because DOS and Windows are unprotected operating environments, other software can corrupt memory used by the database engine. This problem may be detected through software errors or crashes, or the corrupt memory could get written to the database creating a corrupt database file. Also, in any operating system, hardware problems with the disk could cause the database file to get corrupted.

If you do have errors reported, you can drop all of the indexes and keys on a table and recreate them. Any foreign keys to the table will also need to be recreated. Another solution to errors reported by VALIDATE TABLE is to unload and reload your entire database. You should use the -u option of DBUNLOAD so that it will not try to use a possibly corrupt index to order the data.

Contents IndexUPDATE (positioned) statement WHENEVER statement