SearchTokenIndex

ODBPPLib.IODBPP.SearchTokenIndex creates a temporary internal index that contains all matching objects to the search. Once the internal index is created, you can use ReadObject or DeleteObject, with the search modes to read in the objects.
ulong SearchTokenIndex (
   uint tableId,
   uint index,
   object binaryKey,
   object tokenKey,
   bool acquireObjectLocks
);

Parameters

tableId The table Id defining the table's handle.
index The index value, 0 for object ID hash index is invalid, 1 for the first defined index
binaryKey The buffer containing the binary key value used in the search of the binary section of a ODBPP.A_LIST or a ODBPP.W_LIST key search.
tokenKey The buffer containing the token section for a ODBPP.A_LIST or a ODBPP.W_LIST key search. This variable is of type void beacuse for a ODBPP.A_LIST the string should be in ASCII format, while for a ODBPP.W_LIST it should be a wide character string.
acquireObjectLocks With this set to true, this method will acquire all object locks before returning NO_ERROR, else the read method will acquire the object lock.

Return Values

SearchTokenIndex returns the total amount of object found in the search.

Remarks

  • This method is used for seaching indexes of index type ODBPP.A_LIST and ODBPP.W_LIST.
  • SearchTokenIndex will not return an error if there are no matching results for the search, read the first object to see if there is or not, any results matching the search.
Example Use
  • C#
public static uint FIRST_TABLE = 1;
private void button1_Click(object sender, EventArgs e)
   try{
      ODBPPLib.ODBPP odbpp = new ODBPPLib.ODBPP();
      odbpp.OpenDatabase("C:\\My\\Database\\Control\\File.odc");
      odbpp.BeginTransaction(odbpp.SHARED, 60000);
      odbpp.OpenTable(FIRST_TABLE);
      odbpp.SearchTokenIndex(FIRST_TABLE, 1, null,"token or token",true);
      result = odbpp.ReadObject(FIRST_TABLE, odbpp.FIRST, 1, key);
      while(result != null)
      {
         result = odbpp.ReadObject(FIRST_TABLE, odbpp.NEXT, 1);
      }
   }
   catch (Exception e1)
   {
      MessageBox.Show(e1.Message);
   }
}

Also See

DeleteObject, ReadObject, SearchSpatialIndex
 

Contact Ekky Software

All around the world Ekky Software is contactable seven days of the week by submitting the following details.

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

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