-20356 THE TABLE WITH DBID = dbid AND OBID = obid CANNOT BE TRUNCATED BECAUSE DELETE TRIGGERS EXIST FOR THE TABLE, OR THE TABLE IS THE PARENT TABLE IN A REFERENTIAL CONSTRAINT
Explanation
The TRUNCATE statement could not be processed
for one of the following reasons:
- The TRUNCATE statement would result in the activation of DELETE triggers, but the statement specified RESTRICT WHEN DELETE TRIGGERS, either implicitly or explicitly. This can occur when enabled DELETE triggers exist for the table to be truncated, and the result of the TRUNCATE statement would activate the triggers.
- The table to be truncated is the parent table of a child table, regardless of whether the child table contains rows or not, that are in a referential constraint.
dbid.obid Gives the database id and the table obid of the object with the truncation error.
System action
The statement cannot be processed.
User response
If the statement failed because of the existence of DELETE triggers, specify the IGNORE DELETE TRIGGERS clause on the TRUNCATE statement. If the statement failed because of referential constraints, use the ALTER TABLE statement to drop the referential integrity constraints, and then re-issue the TRUNCATE statement.
SQLSTATE
428GJ