Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbCloneTable

Creates a new clone based on an existing table.

Declaration

CTDBRET ctdbCloneTable( CTHANDLE tarTableHandle, pTEXT tarTableName, CTHANDLE srcTableHandle )

Description

ctdbCloneTable() creates a new table with the attributes from an existing source table. This does NOT create a duplicate table -- records are not copied.

Note: This function is only for a CTSESSION_CTREE session or for cloning tables from/into different databases.

  • tarTableHandle [in] - The new table handle
  • tarTableName [in] - The new table name
  • srcTableHandle [out] - The source table handle

Returns

ctdbCloneTable() returns CTDBRET_OK on success, or c-treeDB API error code on failure. Typical ctdbCreateTable() errors are possible.

Example

CTHANDLE hSession = ctdbAllocSession(CTSESSION_CTREE);

CTHANDLE custmast = ctdbAllocTable( hSession );

CTHANDLE custmast_clone = ctdbAllocTable( hSession );

ctdbOpenTable( custmast, "custmast", CTOPEN_NORMAL );


ctdbCloneTable( custmast_clone, "custmast_clone", custmast );

See also

ctdbCreateTable()

TOCIndex