SQL Guide : solidDB® SQL statements : TRUNCATE TABLE
  
TRUNCATE TABLE
TRUNCATE TABLE tablename
Usage
The TRUNCATE statement removes all rows from a table. The TRUNCATE statement is semantically equivalent to a DELETE FROM tablename statement. However, it is much more efficient due to relaxed isolation.
Restrictions
During the execution of this statement, the defined isolation level is not maintained in concurrent transactions. The effect of removing the rows is seen immediately in all concurrent transactions. Therefore, this statement is recommended for maintenance purposes only.
When the truncated table participates in a referential integrity constraint as a referenced table, the TRUNCATE statement fails if the referencing table is not empty, regardless of the referential action defined (RESTRICT, CASCADE, and so on). The restriction does not apply if the referencing table is the same as the referenced table (a tree-structured table).
If a collection of interrelated tables is to be truncated, the TRUNCATE statements should be issued in the order starting from the tables that are referencing tables only, up the way of the referencing chain, and ending up with the table that is a referenced table only.
In Universal Cache setups where solidDB® is a source database, the TRUNCATE TABLE statement is not allowed on tables which are part of a subscription. If this rule is violated, an error is returned to the application.
See also
solidDB® SQL statements