Page 1 of 1

Using a key field

Posted: Fri 11 Sep 2015 11:01
by jota
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

Re: Using a key field

Posted: Fri 11 Sep 2015 17:31
by FCS
Hello,

Here you can find a few answers:

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

Regards
Michal

Re: Using a key field

Posted: Tue 15 Sep 2015 13:25
by azyk
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.

Re: Using a key field

Posted: Tue 15 Sep 2015 18:46
by jota
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

Re: Using a key field

Posted: Thu 17 Sep 2015 10:39
by MaximG
You are absolutely right. The previous answer is applicable to SQLite as well.