SqlSelect doesn't find text in textfield

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Sep 23 09:28:33 CDT 2008


On 9/23/08 5:15 PM, "Thorsten Hohage" <thohage at genericobjects.de> wrote:

> Hi Markus,
> 
> On 2008-09-23, at 16:05, Markus Fraefel wrote:
> 
>> res = gDB.SqlSelect( "SELECT Kapitel, Lauftext, zielFrame FROM
>> Seiten_de
>> WHERE Kapitel LIKE '%" & Valentina.EscapeString(searchTerm,1) & "%' OR
>> Lauftext LIKE '%" &  Valentina.EscapeString(searchTerm,1) & "%'",
>> #kServerSide, #kReadWrite, #kRandom )
> 
> 
> 
> (ist ein bisschen haarig mit dem ganzen Code drumrum :-)) )
> 
> 
> res = gDB.SqlSelect( "SELECT Kapitel, Lauftext, zielFrame FROM Seiten_de
> WHERE lower(Kapitel) LIKE lower('%" &
> Valentina.EscapeString(searchTerm,1) & "%') OR
> lower(Lauftext) LIKE lower('%" &  Valentina.EscapeString(searchTerm,1)
> & "%')",
> #kServerSide, #kReadWrite, #kRandom )

Although please note
    lower() on both sides will mean NON indexed search.

To have fast search with indexes, better define in this table one more filed
-- calculated field, aka Table Method with

Let you have 

CREATE TABLE T1
(
    fld_text TEXT,
    fld_txt_lwr TEXT METHOD('lower(fld_text)') INDEXED
)


Now you can do

    WHERE fld_text_lwr = lower('some string')


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list