CTTable::Truncate
Removes all records from an existing table.
Declaration
void CTTable::Truncate();
Description
CTTable::Truncate() truncates a data file, meaning a new copy of the file is created with no data records. File properties and resources are preserved. The function closes the table, truncates it, and reopens it. Return value of CTDBRET_OK indicates success.
Return
A CTException is thrown when an error occurs. Use CTException::GetErrorCode() and CTException::GetErrorMsg() to retrieve the error code and descriptive message.
Limitations
Requires data file to have an IFIL resource; otherwise, the function call fails with error RNOT_ERR (408, resource not found).
See Also
CTDatabase::DeleteTable()