Using a key field

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jota
Posts: 34
Joined: Tue 22 Nov 2011 19:21

Using a key field

Post by jota » Fri 11 Sep 2015 11:01

Hello

I define the following index in my database:

CREATE UNIQUE INDEX "IndTreeView" ON "TreeElements" ("KeyPad" ASC,"KeyEle" ASC)

Which properties should I use in 'tunitable' component if I want to use that index with 'findkey', 'locate', etc ?

Code: Select all

tunitable.IndexFieldNames := KeyPad, KeyEle    // only this property ?
tunitable.KeyFields := KeyPad, KeyEle          // this too ?
Separator between keys in both case, comma or semicolon?

Thanks in advances

FCS
Posts: 176
Joined: Sat 23 Feb 2013 18:46

Re: Using a key field

Post by FCS » Fri 11 Sep 2015 17:31

Hello,

Here you can find a few answers:

http://forums.devart.com/viewtopic.php?f=28&t=32380

Regards
Michal

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Using a key field

Post by azyk » Tue 15 Sep 2015 13:25

Server indexes are used on ordering and searching data on the server side automatically, for example, on executing clauses WHERE, ORDER BY, etc. Client can't use server indexes. Therefore, when using local ordering and search (methods IndexFieldNames, Locate, etc..), we don't use server indexes. TUniTable has no such methods, that could allow using server index on the client side.

jota
Posts: 34
Joined: Tue 22 Nov 2011 19:21

Re: Using a key field

Post by jota » Tue 15 Sep 2015 18:46

Hello

Thank you both for the answers

Sorry, I´m using Sqlite database. The previous answer about the indexes is it right for this db?

Thanks

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Using a key field

Post by MaximG » Thu 17 Sep 2015 10:39

You are absolutely right. The previous answer is applicable to SQLite as well.

Post Reply