mcDBgetSet, mcDBgetSetArray — Read dataset from database
#include <memcom.h> void* mcDBgetSet(int handle, const char* name, mcSize size); int mcDBgetSetArray(int handle, const char* name, mcSize size, void* array);
mcDBgetSet
retrieves a dataset from a
database. If completed successfully, the function returns a pointer
to a new array containing the requested data. Otherwise,
NULL
is returned and the error code can be
retrieved by the function mcErrStatus
.
mcDBgetSetArray
retrieves a dataset from a
database to a pre-allocated array in memory. If completed
successfully, the function returns 0. Otherwise, a negative value
indicating the MemCom error number is
returned.
It is strongly advised to free data allocated with
mcDBgetSet
by means of the mcDBfree
. Note
that relational tables must be freed by means of mcTBfree
.
handle
Database handle (input).
name
Dataset name (input).
size
Number of data elements to be read (input). If set to 0, the entire set will be read in memory.
array
Address of array to which set is copied (input). The calling function must make sure that the array is large enough to hold the data of specific type!