Board index » delphi » Problems searching records using a secondary index

Problems searching records using a secondary index

Hi all,

I don't understand why the BDE perfoms a table scan when I set to
Table.IndexName a name of a secondary index and then call Table.Locate using
the field that compounds the index.

Example:

  Table.IndexName := 'IDCustomer';
  Table.Locate( 'IDCustomer', 44, [] );

Using SQLMonitor I saw that it calls fetch until all the records that apply
to the condition have been download from server.

I don't understand why it behaves that way.

Can anybody tell me what am I doing wrong? Please!

TIA,

Joan

 

Re:Problems searching records using a secondary index


Don't you use Oracle?  If so, always use TQuery.  Never use Locate;  you
have now seen why not.  Use a parameterized TQuery:  SELECT SOMETHING
FROM TABLE WHERE VALUE = :VALUE.

John

Other Threads