Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Manual says I can't use Table1.IndexFieldNames with UNI_CI. Really?
Mon, Jan 20 2014 2:27 PMPermanent Link

Barry

I was reading over the manual today and was surprised to find the following paragraph on page 162:

>Note
Setting the IndexColumnNames will not work on indexes that contain descending columns or
contain columns using case-insensitive collations, so you must use the IndexName property
instead. Please see the Internationalization topic for information on collations and index columns.<

1)
All of my VarChar's are  COLLATE "UNI_CI" so does this mean I can never use
  Table1.IndexFieldNames := 'FirstName;LastName';
and have to use the index name instead like:
  Table1.IndexName := 'ix_Name';

Really???

I think what the manual should have said was (and correct me if I'm wrong), "If the table has two or more indexes using the same starting field names, then you must specify the index name to ensure the correct collation index is used." I personally don't see why IndexFieldNames won't work if there is only one index using those fields.

2) What is "TEDBTable.IndexColumnNames"? There are a dozen or so references to a table property called "IndexColumnNames" in the Delphi PDF manual. I think this is a typo and it should be "IndexFieldNames". Right?

TIA
Barry
Thu, Jan 23 2014 5:17 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Barry,

<< 1)
All of my VarChar's are  COLLATE "UNI_CI" so does this mean I can never use
  Table1.IndexFieldNames := 'FirstName;LastName';
and have to use the index name instead like:
  Table1.IndexName := 'ix_Name';

Really??? >>

Yes.  If you some indexes that were ascending and some that were descending
on the same fields, how would it know which index to select from just the
field names ?

<< I think what the manual should have said was (and correct me if I'm
wrong), "If the table has two or more indexes using the same starting field
names, then you must specify the index name to ensure the correct collation
index is used." I personally don't see why IndexFieldNames won't work if
there is only one index using those fields. >>

Check out the DB.pas unit:  TIndexDefs.GetIndexForFields.  This is not our
code, and to maintain compatibility with existing applications, I just leave
it alone.

<< 2) What is "TEDBTable.IndexColumnNames"? There are a dozen or so
references to a table property called "IndexColumnNames" in the Delphi PDF
manual. I think this is a typo and it should be "IndexFieldNames". Right? >>

Yes, it's a typo.  It's now fixed.

Tim Young
Elevate Software
www.elevatesoft.com
Image