Class ODBPP::Schema

Used to represent a table within the database.
class Schema{
public:
   unsigned short indexLockOrder;
   unsigned short indexCount;
   unsigned int tableID;
   unsigned int tableLockOrder;
   unsigned int fieldCount;
   unsigned int flags;
   char16_t *tableName;
   char16_t *indexPath;
   CODBPP::Field *fields;
   CODBPP::Index *indexes;
};

Members

indexLockOrderthe index that the global locking order is to adhere to - 0 for the ObjectID.
indexCountthe amount of indexes - the length of the indexes array.
tableIDthe table's identifier.
tableLockOrderthe position that this table is in the global locking order.
fieldCountthe amount of fields - the length of the fields array.
flags0x01 - 64 bit Object IDs, 0 = no, 1 = yes
0x02 - Inverted index lock order, 0 = no, 1 = yes
tableName'' terminating string for the table name.
indexPath'' terminating string for the index file path - null if using the same directory as the table file.
fieldspointer to an array of fields.
indexespointer to an array of indexes.

Remarks

Example Use
  • C++
#include "ODBPP.h"

CODBPP::Segment index1Segments[] = {{0,(CODBPP::Mode)0}};
CODBPP::Index indexes[] = {{0,CODBPP::B_TREE,1,0,index1Segments}
CODBPP::Field fields[] = {
   {CODBPP::UINT32, 0, 4, 0,u"First"},
   {CODBPP::FLOAT64,8, 8, 0,u"Second"},
   {CODBPP::ASTR,   16,32,0,u"Third"}
};
CODBPP::Schema schema = {0,1,0,0,3,0,u"Table Name",NULL,fields, indexes};

int wmain(int argc, wchar_t* argv[])
{
   unsigned __int64 error;
   const char16_t *message;
   CODBPP database;
   if(database.OpenDatabase(u"YourDatabase") == NO_ERROR){
      if((error = database.BeginTransaction(CODBPP::EXCLUSIVE)) == NO_ERROR){
         if((error = database.CreateTable(&schema)) == NO_ERROR){
            ...
         }
      }
      if(error && database.GetErrorMessage(&message) == NO_ERROR)
         MessageBox(message);
      database.EndTransaction();
   }
   return NO_ERROR;
}

Also See

CreateTable, GetTableSchema, SetTableSchema
Listen All
Comments (0)
Characters left: 2500
 

Contact Ekky

Thanks for your interest.

Ekky Software Customer Support Team.

Ekky Software Product Range
Ekky Software Homepage T-Accounts Online ObjectDatabase++ TScript Ekky Software Homepage T-Accounts Onlinee ObjectDatabase++ TScript