Class ODBPP::Segment

Used to represent an index segment within the index of a table.
class Segment{
public:
   int field;
   enum CODBPP::Mode mode;
};

Members

field Valid values are -1 for the objectID and -2 for the row count with multi-entry indexes, all others values are the schema array index value of the field. The absolute field positon values for sub-table fields are as follws in the diagram below.
Image of Field Number Order
mode

Valid modes for types within CODBPP::B_TREE index types are CODBPP::ASTR and CODBPP::USTR are CODBPP::DESCENDING or CODBPP::INVERTED or (CODBPP::TO_UPPER_CASE xor CODBPP::TO_LOWER_CASE). Valid modes for all types are CODBPP::DESCENDING or CODBPP::NONE.

Valid modes for type within CODBPP::S_TREE indexes are CODBPP::NONE only.

Valid modes for type within CODBPP::A_LIST and CODBPP::U_LIST indexes are CODBPP::TOKEN_FIELD or (CODBPP::TO_UPPER_CASE xor CODBPP::TO_LOWER_CASE), the binary fields within a token index are by default value.

Remarks

Example Use
CODBPP database;
CODBPP::Schema schema;
CODBPP::Field fields[3];
memset(&schema,0,sizeof(CODBPP::Schema));
schema.tableName = TEXT("Table Name");
schema.fieldCount = 3;
schema.fields = &fields;
memset(schema.fields,0,schema.fieldCount * sizeof(CODBPP::Field));
schema.fields[0].type = CODBPP::UINT32;
schema.fields[0].name = TEXT("First");
schema.fields[1].type = CODBPP::FLOAT64;
schema.fields[1].name = TEXT("Second");
schema.fields[2].type = CODBPP::ASTR;
schema.fields[2].name = TEXT("Third");
if(database.OpenDatabase(TEXT("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();
}

Also See

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

Contact Ekky Software

Thank you for your time and interest.
Ekky Software Customer Support Team.

Ekky Software Product Range
Ekky Software Homepage Ekky Software Homepage ObjectDatabase++ TScript Ekky Software Homepage Ekky Software Homepage ObjectDatabase++ TScript