CONTAINS()

From Recital Documentation Wiki
Revision as of 12:30, 17 November 2010 by Yvonnemilne (Talk | contribs)

Jump to: navigation, search

Purpose

Function to perform a case-insensitive search of a record's character and (optionally) memo fields for a specified character string


Syntax

CONTAINS(<expC>,[<expL>|<expN>])


See Also

BETWEEN(), CHROVERLAP(), EMPTY(), EVALUATE(), EXPRCHECK(), FOR(), INDEX, INLIST(), INRANGE(), ISALPHA(), ISBLANK(), ISDIGIT(), MAX(), MAXVALUES(), MIN(), MINVALUES(), MTOS(), Relational Operators, SEEK, SEEK(), TYPE(), VARTYPE()


Description

The CONTAINS() function returns .T. (True) if the current record contains the specified character string, <expC>.

A case-insensitive search is performed on the current record's character fields. If the optional <expL> is .T. (True) or the optional <expN> is 1, memo fields are also checked, otherwise they are excluded from the search.


Parameters Description
<expC> The character string to search for.
<expL> If .T. (True), memos are included in the search.
<expN> If 1, memos are included in the search.


The CONTAINS() function is particularly useful in creating full text-search indexes, as shown in the example below.


Example

open database southwind
use products
// Restrict index to product records in category 2 (condiments) with a character field containing string "bottled", memos excluded
index on lower(productname) for contains("bottles",.F.) and categoryid = 2 tag bottled


Products

Recital Server, Recital