Subject Re: [ib-support] Key of varying length problem
Author Paul Schmidt
On 12 Nov 2001, at 16:11, Robert F. Tulloch wrote:

> > Given that each character has a different meaning, and that they
> > cover progressively larger areas as you move from right to left, it
> > makes it more complex. For example K9J 5A2 is a postal code (I
> > actually lived there my first 20 years or so, the other side of this
> > one block street was K9J 5A3). Now here is the problem, if each
> > were a dos file, then K9J is the equivilent of K9J* In other words
> > it should match any postal code that starts with K9J. I can do
> > this, however the problem is, that if I have K9J and I have K9 or
> > even K then K9J 5A2 should match K9J but NOT K9 or K. That is where
> > the problem is. I don't know how to tell it to look until it finds
> > a match and then quit.
> Oh, that is no sweat. I do that with lookups in a database all the
> time.
> I just do a locate and if it fails repeat in a loop knocking off the
> last character until it hits. I chopped some out of this below.

Okay, I can do it in code, with a bunch of selects, that's no
problem, however I wanted to do it with purely SQL code, even if
that meant using an SP, however SQL doesn't have implemented a
string hack routine (like basics Left$, Mid$ and Right$ routines).

I saw a couple of UDF libraries, one from Mers where the docs
haven't been updated since IB 4.0 and the section on the licence is
about as clear as a swamp. The other one, FreeUdfLibC had no
real docs at all, and nothing about the licence at all. I need to use
tools with clear licencing, and decent docs....

Maybe I will eventually write my own, but not for this project....


Paul Schmidt
Tricat Technologies