Re: Substring query

From: BP Margolin <bpmargo_at_attglobal.net>
Date: Thu, 15 Feb 2001 10:33:50 -0500
Message-ID: <e4LVpQ2lAHA.1692_at_tkmsftngp02>


James,

Would it be possible for you to post some sample data, and the results you are looking for using that sample data?

Perhaps it's just me, but I really can't make heads or tails out of what you are requesting. Remember that you know your data and application, but we don't, so examples are frequently very helpful in explaining a problem.



BP Margolin
Please reply only to the newsgroups.
When posting, inclusion of SQL (CREATE TABLE ..., INSERT ..., etc.) which can be cut and pasted into Query Analyzer is appreciated.

"James Avery" <avery_at_wapmore.com> wrote in message news:3A8B26E7.10ED502C_at_wapmore.com...
> Hi,
>
> I'm in a situation where whole classes of keys correspond to a single
> database entry - that is, the key in the database should be a pattern
> rather than an exact string.
>
> What I need is to be able to create a function ´lookup´, where
>
> lookup(string) = { entry(key) | string matches key }
>
> Alternately it could be
>
> lookup(string) = { entry(key) | key is a substring of string }
>
> where the entry could be a (regexp,realkey) pair, and I could check the
> entries of the returned set in turn.
>
> In short, the problem is thus: the strings used to look up entries can
> be partitioned into parts that contribute to the selection of an entry
> and parts that are irrelevant - the irrelevant parts being variable.
> Which parts are which is impossible to determine.
> On creation of the database, it is known, however.
>
> So, is it possible to make a query that returns the set of entries (or
> of keys) where the entries' key is a substring of the queried string?
>
> All help is appreciated.
>
> Thanks in advance. Please CC: to email, since the trafic of the
> newsgroup makes it easy to miss a reply otherwise.
>
> --
> Med venlig hilsen,
> James Avery <avery_at_wapmore.com>
Received on Thu Feb 15 2001 - 16:33:50 CET

Original text of this message