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

Reply via email to