Another Neophyte SQL Question

Bart Pietercil bart.pietercil at gmail.com
Thu Feb 15 13:07:18 CST 2007


 From the Valentina Kernel pdf

IndexByWords as Boolean
When this flag is TRUE, the index is built for each word of the  
string. This is very useful for
large strings (50 characters and more).
For example, let’s say we have one record with the value «aaa bbb ccc  
ddd». If the field
is indexed by words, then search conditions like «bb», «ccc», or «d»  
they will return that
record. If the field is not indexed by words, then said conditions  
return nothing. Only condi-
tions like «a», «aa», «aaa bb» (i.e., which match to the beginning of  
the string) will return
the record.
• If a field is indexed by words, then it can not be sorted, because  
there is no index on the
beginning of the string field.
• On creation of  String and VarChar fields Valentina sets this flag  
in TRUE if you specify
the length more than 255 bytes. You can set this property in FALSE  
right after creation of
a field if you don’t want to index the field by words.
• Changing of the IndexByWords property will require rebuilding the  
index.
   fldString.IndexByWords = TRUE

So if you have checked for the VText field the flag Index By WOrds  
your search will return the record where a word is contained in  
searched field

hth

Bart Pietercil



On 15-feb-07, at 19:55, Chuck Pelto wrote:

> Greetings,
>
> If I have multiple search criteria in a textual field, how would I  
> have to write the SQL query?
>
> Case in point, I have a VText field with scads of text in it, say  
> from on-line newspaper articles.
>
> I want to find all the articles that mention "strawberries" and  
> "gun laws".
>
> Which is the proper syntax to use?
>
> "....WHERE f1 LIKE %'" + value1 + "'% AND LIKE %'" + value2 +  
> "'%" // mentioning the field only once for all values to be checked  
> for
>
> or
>
> "....WHERE f1 LIKE %'" + value1 + "'% AND f1 LIKE %'" + value2 +  
> "'%" // mentioning the field for every value to be checked for
>
>
> Regards,
>
> Chuck
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina



More information about the Valentina mailing list