MemCom Reference Manual > MemCom C API Manual Pages > Sparse Table Functions > mcSTcolAttributes

Name

mcSTcolAttributes — Obtain the attributes of a column of a sparse-table dataset

Synopsis

#include <memcom.h>

int mcSTcolAttributes(int dsid, mcInt64 column_index, 
                      char* name, char* type, mcInt64* num_elements);

Description

mcSTcolAttributes obtains, for the sparse-table dataset identified by dsid, the column attributes as they were set when the column was created by calling mcSTcolAppend.

Parameters

dsid (input)

Dataset identifier.

column_index (input)

Index of the column whose attributes are inquired about. Column indices start at 1.

name (output)

If not NULL, the name of the column will be copied as a NUL-terminated character string to name. The buffer must be at least 64 characters long.

type (output)

If not NULL, the data element type of the column will be copied as a NUL-terminated character string to type. The buffer must be at least 2 characters long.

num_elements (output)

If not NULL, the number of data elements for the column will be copied to num_elements, which is in this case a pointer to a single element of type mcInt64. A value of 0 indicates a variable-sized column, where for each cell belonging to this column, the actual number of elements can be obtained by calling mcSTcellNumElements.

Return Value

If the column exists and its attributes could be obtained, 0 is returned. Otherwise, a negative value indicating the MemCom error number is returned.

See Also

mcSTcolAppend, mcSTcolNum