mcTBstore — Store relational table
#include <memcom.h> int mcTBstore(int handle, const char* name, mcOff idiv, mcRTable* rt);
mcTBstore
stores a relational table in
memory to a database identified by handle
. Once
stored, the table in memory can be freed by the function
mcTBfree
. If completed successfully, the
function returns 0. Otherwise, a negative value indicating the
MemCom error number is returned.
mcTBstore
also supports writing to a row
(identified by idiv
) of a sparse-table dataset.
In this case, variable-sized sparse-table columns must be added with
mcSTcolAppend
prior to calling
mcTBstore
. It is worth mentioning that using
the sparse-table functions instead of
mcTBstore
for sub-tables will result in better
performance.
handle
Database handle (input).
name
Name of relational table to be stored (input). The name overrides the current name of the table in memory (if any). Alternatively, this can be the name of a sparse-table dataset.
idiv
Index of sub-table to be written (input). If no
sub-table has been defined, i.e idiv=0
the sub-table is ignored. If a sub-table has been defined,
idiv
must be in the range of 1 to the
number of defined sub-tables.
For sparse-table datasets, idiv
must be positive and smaller or equal to the number of rows
of the dataset.
rt
Pointer to table in memory to be written to the database (input).