FTS MATCH was a great solution to that particular problem. Thanks again, Dr. 
Hipp!

Back to original question... Is it at all possible to pass the results of a 
SELECT to a WHERE expression? I have used a SELECT to create a full statement 
but then I have to copy the result to a query editor and execute it. 

Tom

> On Oct 16, 2014, at 12:55 PM, Tom Holden <ve3...@gmail.com> wrote:
> 
> I think you are right. The FTS MATCH looks like it should function the way
> I want.
> 
> Thanks, Richard! I will now learn how to use FTS...
> 
> Tom
> 
>> On Thu, Oct 16, 2014 at 12:20 PM, Richard Hipp <d...@sqlite.org> wrote:
>> 
>>> On Thu, Oct 16, 2014 at 12:03 PM, Tom Holden <ve3...@gmail.com> wrote:
>>> 
>>> Coming up with a subject was a struggle and maybe that indicates an
>>> impossibility. Searching the archive was equally fruitless.
>>> 
>> 
>> Perhaps what you really want is Full Text Search.
>> http://www.sqlite.org/fts3.html
>> 
>> 
>>> 
>>> What I am trying to do is to build a SELECT with a compound WHERE  using
>>> one or more run-time parameters. Sort of like transforming an input
>> phrase
>>> such as:
>>> "string1+string2+string3..."
>>> INTO
>>> WHERE
>>> [Value] LIKE '%string1%'
>>> AND
>>> [Value] LIKE '%string2%'
>>> AND
>>> [Value] LIKE '%string3%'
>>> AND...
>>> 
>>> This brute force method works:
>>> WHERE
>>> [Value] LIKE '%'||$SearchString_ONE||'%'
>>> AND
>>> [Value] LIKE '%'||$SearchString_TWO||'%'
>>> ...
>>> but requires every parameter to be acted on (filled in or made blank).
>>> 
>>> I can build a statement that produces a desirable looking expression but
>>> cannot evaluate it as such with WHERE:
>>> 
>>> SELECT '[Value] LIKE '||'''%'||REPLACE($SearchString, '+', '%'''||' AND
>>> [Value] LIKE '||'''%')||'%'''
>>> produces
>>> [Value] LIKE '%string1%' AND [Value] LIKE '%string2%' AND [Value] LIKE
>>> '%string3%'
>>> 
>>> but
>>> 
>>> WHERE (above SELECT...) evaluates to FALSE
>>> 
>>> I need a way to convert the text result to an expression that WHERE
>>> evaluates as an expression.
>>> 
>>> Any possibility to do this within SQLite?
>>> 
>>> Tom
>>> _______________________________________________
>>> sqlite-users mailing list
>>> sqlite-users@sqlite.org
>>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>> 
>> 
>> 
>> 
>> --
>> D. Richard Hipp
>> d...@sqlite.org
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> 
> 
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to