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

tableIdthe table Id defining the table's handle.
indexthe index value, 0 for object ID hash index is invalid, 1 for the first defined index.
binaryKeythe 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.
tokenKeythe 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.
acquireObjectLockswith 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
Listen All
Comments (0)
Characters left: 2500
 
Ekky Software Homepage T-Accounts Online ObjectDatabase++ TScript Ekky Software Homepage T-Accounts Onlinee ObjectDatabase++ TScript