Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 10 of 21 total |
Problem getting Range to work in v1.02 |
Tue, Apr 10 2007 3:33 AM | Permanent Link |
Dave Harrison | I have a table with a string column and I want to do a range on all
words starting with "abc". So I have a range like: SetRangeStart; FieldByName('Company').AsString := StartsWith; SetRangeEnd; FieldByName('Company').AsString := StartsWith+'zzzz'; ApplyRange; For some reason it is never finding any rows. The index is case insenstive and is a compound key. Company is the first field of the index. Also I noticed I can't assigned Table1.IndexFieldNames := 'Company'; even though there is an index that starts with the Company field. I have to specify the index name instead of the index field names. Has anyone else noticed this? Dave v1.02 |
Tue, Apr 10 2007 5:47 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Dave
>Also I noticed I can't assigned > >Table1.IndexFieldNames := 'Company'; > >even though there is an index that starts with the Company field. I have >to specify the index name instead of the index field names. > >Has anyone else noticed this? If there are any descending columns in the table that will do it. Roy Lambert |
Tue, Apr 10 2007 11:32 AM | Permanent Link |
Dave Harrison | Roy Lambert wrote:
> Dave > > > >>Also I noticed I can't assigned >> >>Table1.IndexFieldNames := 'Company'; >> >>even though there is an index that starts with the Company field. I have >>to specify the index name instead of the index field names. >> >>Has anyone else noticed this? > > > If there are any descending columns in the table that will do it. > Roy, Yes there is a descending column at the end of the compound index. But this same index structure works fine on other databases and their ranges. If ElevateDb can't do a range with a descending field in the index, I guess I can scratch ElevateDb off my list of databases. I also created another index with only the one string field in it and it too won't work properly in the Range, the range is always empty. The field is case insensitive. I'm going to create another index but this time case sensitive and see if I can get ranges to work. Dave |
Tue, Apr 10 2007 12:55 PM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Dave
What I was told was that you need to use IndexName not IndexFieldNames. Apparently its a problem with TDataSet. Roy Lambert |
Tue, Apr 10 2007 1:34 PM | Permanent Link |
Dave Harrison | Roy Lambert wrote:
> Dave > > > What I was told was that you need to use IndexName not IndexFieldNames. Apparently its a problem with TDataSet. > > Roy Lambert > Roy, I had tried setting the index with the index name instead of index field names. I just don't think SetRangeStart.., SetRangeEnd, and ApplyRange are working in 1.02. Dave |
Tue, Apr 10 2007 3:09 PM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Dave
OUCH! Roy Lambert |
Tue, Apr 10 2007 9:07 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Dave,
<< I have a table with a string column and I want to do a range on all words starting with "abc". So I have a range like: SetRangeStart; FieldByName('Company').AsString := StartsWith; SetRangeEnd; FieldByName('Company').AsString := StartsWith+'zzzz'; ApplyRange; >> You're not setting the KeyFieldCount, so EDB thinks that the number of columns being used in the range is 0. You need to set the KeyFieldCount property for the beginning and ending of the range. I'm looking into changing this for the ApplyRange and Goto* methods, but for now they require the KeyFieldCount setting. -- Tim Young Elevate Software www.elevatesoft.com |
Wed, Apr 11 2007 2:16 AM | Permanent Link |
Dave Harrison | Tim Young [Elevate Software] wrote:
> Dave, > > << I have a table with a string column and I want to do a range on all words > starting with "abc". So I have a range like: > > SetRangeStart; > FieldByName('Company').AsString := StartsWith; > SetRangeEnd; > FieldByName('Company').AsString := StartsWith+'zzzz'; > ApplyRange; >> > > You're not setting the KeyFieldCount, so EDB thinks that the number of > columns being used in the range is 0. You need to set the KeyFieldCount > property for the beginning and ending of the range. I'm looking into > changing this for the ApplyRange and Goto* methods, but for now they require > the KeyFieldCount setting. > I tried your suggestion and it worked, sort of. A range of "x" to "xz" will find the rows starting with "x" but will also include those starting with "y" and "z". So it starts from the correct row but returns all rows to the end of the table. The column is case-insensitive. Also it takes 6 to 7 seconds to execute the range on a million row table. Dave |
Wed, Apr 11 2007 3:21 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Dave,
<< I tried your suggestion and it worked, sort of. A range of "x" to "xz" will find the rows starting with "x" but will also include those starting with "y" and "z". So it starts from the correct row but returns all rows to the end of the table. The column is case-insensitive. Also it takes 6 to 7 seconds to execute the range on a million row table. >> And you're sure that you're running 1.02 ? I tried the following here with the DBDEMOS Customer table (ByCompany active index) and it works fine: with Table do begin SetRangeStart; FieldByName('Company').AsString := 'diver'; KeyFieldCount:=1; SetRangeEnd; FieldByName('Company').AsString := 'diverzzzz'; KeyFieldCount:=1; ApplyRange; end; Could you send me the table that you're using ? -- Tim Young Elevate Software www.elevatesoft.com |
Wed, Apr 11 2007 4:40 PM | Permanent Link |
Dave Harrison | Tim Young [Elevate Software] wrote:
> Dave, > > << I tried your suggestion and it worked, sort of. A range of "x" to "xz" > will find the rows starting with "x" but will also include those starting > with "y" and "z". So it starts from the correct row but returns all rows to > the end of the table. The column is case-insensitive. Also it takes 6 to 7 > seconds to execute the range on a million row table. >> > > And you're sure that you're running 1.02 ? The table's engine version says "1.02 build 1". > > I tried the following here with the DBDEMOS Customer table (ByCompany active > index) and it works fine: > > with Table do > begin > SetRangeStart; > FieldByName('Company').AsString := 'diver'; > KeyFieldCount:=1; > SetRangeEnd; > FieldByName('Company').AsString := 'diverzzzz'; > KeyFieldCount:=1; > ApplyRange; > end; > > Could you send me the table that you're using ? Arggh. Operator error. I used KeyFieldCount:=1 just once, before the SetRangeEnd but not before the ApplyRange. I thought the ApplyRange would use the existing KeyFieldCount value. I added the extra KeyFieldCount and its working find now. Oh well. Stand down from red alert. Dave |
Page 1 of 3 | Next Page » | |
Jump to Page: 1 2 3 |
This web page was last updated on Sunday, May 19, 2024 at 08:46 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |