Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!silver!blank From: blank@silver.bacs.indiana.edu Newsgroups: comp.databases Subject: Re: Clipper/dBase Seek Question Message-ID: <20900014@silver> Date: 21 Aug 89 18:39:00 GMT References: <238@fltk.UUCP> Organization: Indiana University CSCI, Bloomington Lines: 33 Nf-ID: #R:fltk.UUCP:-23800:silver:20900014:000:1050 Nf-From: silver.bacs.indiana.edu!blank Aug 21 13:39:00 1989 >I have a .DBF file indexed on 2 numeric fields of 4 and 6 digits respectively. >More specifically, the index is built by: > > index on str(invnum,4)+str(seqnum,6) to idx_file > >I would like to do a seek specifying only the first index. I am currently >unable to accomplish this (result of seek is EOF). Is this possible to do >and if so, how? I have had to similar searches, and I have tried this technique. When I create the index, I put a delimiter in the string. So, for your example, I would index on: index on str(invnum,4)+"*"+str(seqnum,6) to idx_file Then to do a search on invnum only, i would set exact off and seek str(invnum)+"*" If you do this, you will have to add the delimiter to your seeks that currently work for finding both numbers, like: seek str(invnum)+"*"+str(seqnum,6) Also, make sure that the number of spaces in front of the number are the same. In fact, all of these types of searches, I add a ltrim to avoid the problem: index on ltrim(str(invnum))+"*"+ltrim(str(seqnum)) seek ltrim(str(invnum))+"*" -doug