SearchSpatialIndex

ODBPPLib.IODBPP.SearchSpatialIndex 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 SearchSpatialIndex (
   uint tableId,
   uint index,
   object binaryKey,
   uint errorMargin,
   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 a ODBPP.S_TREE.
errorMarginused for search Spatial Pattern indexes, allowing for matching patterns with the error margin.
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

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

Remarks

  • This method is used for seaching indexes of index type ODBPP.S_TREE, ODBPP.PATTERN.
  • SearchSpatialIndex 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);
      int[] key = { 2, 3, 5, 6 };
      odbpp.SearchSpatialIndex(FIRST_TABLE, 1, key,10,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, SearchTokenIndex
Listen All
Comments (0)
Characters left: 2500
 
Ekky Software Homepage T-Accounts Online ObjectDatabase++ TScript Ekky Software Homepage T-Accounts Onlinee ObjectDatabase++ TScript