Restrictions on the TRUNCATE statement
The TRUNCATE statement fails if any of the following conditions
exist:
- The user does not hold the Delete access privilege on the table.
- The table has an enabled Delete trigger, but the user lacks the Alter privilege.
- The specified table or synonym does not exist in the local database.
- The table was defined by the CREATE EXTERNAL TABLE statement.
- The specified synonym does not reference a table in the local database.
- The statement specifies a synonym for a local table, but the USETABLENAME environment variable is set.
- The statement specifies the name of a view or a synonym for a view.
- The table is a system catalog table or a system-monitoring interface (SMI) table.
- An R-tree index is defined on the table.
- The table is a virtual table (or has a virtual-index interface) for which no valid am_truncate access method exists in the database.
- An Enterprise Replication replicate that is not a master replicate is defined on the table. (For more information about replicates, see the HCL® Informix® Enterprise Replication Guide.)
- A shared or exclusive lock on the table already exists.
- One or more cursors are open on the table.
- A concurrent session with Dirty Read isolation level is reading the table.
- Another table, with at least one row, has an enabled foreign-key constraint on the specified table. (An enabled foreign key constraint of another table that has no rows, however, has no effect on a TRUNCATE operation.)