Creating a new TableSome specific steps must be taken when creating a new table using the c-treeDB API:
The code fragment below creates a new table, with two fields and no indices. Please note that error checking was omitted: /* allocate a new table handle */ hTable = ctdbAllocTable(hDatabase); /* add a field ctdbAddField(hTable, “Field1”, CT_INTEGER, 4); /* add another field */ ctdbAddField(hTable, “Field1”, CT_CHAR, 30); /* create the table */ ctdbCreateTable(hTable, “MyTable”, CTCREATE_NORMAL); "Working with Tables" describes in detail the process of creating a table. |
|||