Distributed Tuning Interface Reference : PvAddTable()
 
PvAddTable()
Creates a new table in the existing dictionary and a data file at the location specified in the table properties.
Header File: ddf.h (See also Header Files)
Function First Available In Library: w3dbav75.dll (Windows), libpsqldti.so (Linux), libpsqldti.dylib (macOS) (See also Link Libraries)
Syntax
PRESULT PvAddTable(
   WORD            dictHandle,
    TABLEINFO*      tableProps,
    COLUMNMAP*      columnList,
   WORD            columnCount,
    INDEXMAP*       indexList,
   WORD            indexCount);
Arguments
 
In
dictHandle
Handle of an open dictionary returned by PvOpenDatabase().
In
tableProps
Structure containing table information.
In
columnList
Array of columns defined in the table.
In
columnCount
Number of columns in columnList.
In
indexList
Array of index definitions.
In
indexCount
Number of indexes in the following indexList array.
Return Values
 
PCM_Success
The operation was successful.
PCM_errFailed
The operation was not successful.
PCM_errInvalidDictionaryHandle
The specified dictionary handle does not exist.
PCM_errTableNotFound
The specified table was not found.
PCM_errMemoryAllocation
An error occurred during memory allocation.
PCM_errInvalidColumnName
The specified column name is invalid.
PCM_errInvalidDataType
The specified data type is invalid.
PCM_errDuplicateColumnName
The column name already exists in the table.
PCM_errInvalidDataSize
The data size is invalid.
PCM_errInvalidIndexName
Index name is invalid.
PCM_errColumnNotFound
Column specified for a segment cannot be found.
Remarks
You must first open a dictionary successfully using PvOpenDatabase().
This function has to be provided with table information, columns, and indexes. indexCount and indexList are optional parameters because indexes are not required to create a table.
This function will fail if a table with the same name is already present in the specified dictionary.
Table properties must be set up correctly and an array of at least one column must be passed.
You will need to allocate and release COLUMNMAP and INDEXMAP arrays and TABLEINFO structure used to describe table. See also COLUMNMAP Flags.
The offset of a field within its row can be accessed through the PvGetTable() function. The COLUMNMAP structure has been modified in ddfstrct.h to contain this additional information. This new field is ignored when calling the PvAddTable() and PvFreeTable() functions. Refer to ddfstrct.h and ddf.h.
See Also
PvStart()
PvOpenDatabase()
PvGetTableNames()
PvFreeTableNames()
PvDropTable()
PvCloseDictionary()
PvStop()