btree.extract error (ENG0017) (OpenInsight Specific)
At 22 OCT 2001 05:07:17PM Wilhelm Schmitt wrote:
What does this error mean:
ENG0017 BTREE.EXTRACT, line 2 Subscript value out of range
The error shows up, after a btree.extract(srchval,datafile,dictfile, keys,'E',flag) on several index fields with several search-values each. (The loopup process for several fields with 1 value each and for only 1 field with several values seems to work fine.)
The routine stops when srchval contains:
FIELD1_XREF
SRCHVAL1
SRCHVAL2
FIELD2_XREF
;SRCHVAL1
SRCHVAL2
FIELD3_XREF
;SRCHVAL1
SRCHVAL2
Any suggestions?
Thanks
Wilhelm
At 06 NOV 2001 01:27PM Wilhelm Schmitt wrote:
I did some tests on the same problem in AREV and got the following results:
Test 1: 1 index, 1 composite value =] OK:
srch_strng=OWNER_XREF":@vm:"MICKEY MOUSE":@fm
Test 2: 1 index, 2 single values =] OK:
srch_strng=OWNER_XREF":@vm:"MICKEY":@vm:"MOUSE":@fm
Test 3: 1 index, 2 composite values =] OK:
srch_strng=OWNER_XREF":@vm:"MICKEY MOUSE":@vm:"DONALD DUCK":@fm
Test 4: 2 indexes, 2 single values =] OK:
srch_strng=OWNER_XREF":@vm:"MICKEY":@vm:"MOUSE":@fm
srch_strng:= "APPLICANT_XREF":@vm:";MICKEY":@vm:"MOUSE":@fm
Test 5: 2 indexes, 2 composite values =] ERROR - subscript value out of range:
srch_val=OWNER_XREF":@vm:"MICKEY MOUSE":@vm:"DONALD DUCK":@fm
srch_val:= "APPLICANT_XREF":@vm:";MICKEY MOUSE":@vm:"DONALD DUCK":@fm
The problem seems to be then with multiple index lookups using multiple composite values. Sometimes, after producing the error, if I want to test 1 - 4 again, there seems to remain garbage in memory, returning 0 results.
I wonder if somebody can give a clue…
Wilhelm
At 07 NOV 2001 06:40AM Oystein Reigem wrote:
Wilhelm,
Why do you search for phrases (what you call "composite values") in Xref indexes? An Xref index usually contains single words, like "MICKEY" and "MOUSE", but not "MICKEY MOUSE".
- Oystein -
At 07 NOV 2001 07:19AM Oystein Reigem wrote:
Wilhelm,
No clue, but I can verify your observation.
What seems to trigger the error is certain characteristics of the second part of the criteria:
- that second part is a search on an XREF
- and the search is for more than one value
- and the second value, or a later one, is a phrase.
The first part of the criteria is not important - it just has to be present. It can be as simple as a search on a single value in a Btree indexed field.
With your specific example it doesn't seem to be any easy workaround. But if you had one XREF and one plain Btree you could get around the problem by having the XREF first in the criteria.
- Oystein -
At 07 NOV 2001 11:46AM Wilhelm Schmitt wrote:
Oystein,
This may be the solution:
Instead of
srch_val=OWNER_XREF":@vm:"MICKEY MOUSE":@vm:"DONALD DUCK":@fm
srch_val:= "APPLICANT_XREF":@vm:";MICKEY MOUSE":@vm:"DONALD DUCK":@fm
I tried
srch_val=OWNER_XREF":@vm:"MICKEY MOUSE":@fm
srch_val:= "OWNER_XREF":@vm:";DONALD DUCK":@fm
srch_val:= "APPLICANT_XREF":@vm:";MICKEY MOUSE"@fm
srch_val:= "APPLICANT_XREF":@vm:";DONALD DUCK":@fm
Seems to work (at least in AREV).
Thanks
Wilhelm
At 08 NOV 2001 07:34AM Oystein Reigem wrote:
Wilhelm,
You're right. It doesn't bomb. (Haven't checked if the search results are correct, but we must assume they are.)
But you haven't told why you search for phrases in cross-ref indexes. Isn't space a delimiter in your indexes?
- Oystein -
At 08 NOV 2001 10:11AM Wilhelm Schmitt wrote:
Oystein,
But you haven't told why you search for phrases in cross-ref indexes. Isn't space a delimiter in your indexes?
Yes, space is a delimiter. I realize that an cross-ref index is essentially a btree, separating each word.
The application is a real-estate database for the public records (with more than 1,500,000 records in the main file). There are xref indexes on actual owner, former owner and applicant. Many of them have 2 first names and 2 last names, and you may have co-propietors (sometimes up to 100).
A frequent search pattern is: person1 or person2 or person 3, either as actual owner or former owner. So, cross-ref comes in very handy, because you don't always have the complete name available.
With btree.extract, searches are narrowed down to manageable results in almost no time.
Wilhelm