Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbTruncateTable

Removes all records from an existing table.

Declaration

ctdbEXPORT CTDBRET ctdbDECL ctdbTruncateTable(CTHANDLE Handle);

Description

  • Handle - open table handle.

ctdbTruncateTable() 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.

Limitations

Requires data file to have an IFIL resource; otherwise, the function call fails with error RNOT_ERR (408, resource not found).

TOCIndex