SearchQueryDBRecords method: Session class

Syntax

SearchQueryDBRecords(SearchType, Pattern, CaseSensitive)

Description

The SearchQueryDBRecords method returns a reference to a QueryDBRecord collection, filled with zero or more records.

Security applies to the results of this list, that is, you have access to all the records your user ID (permission list) allows you to access.

You can use wildcard characters % and _ when searching. % means find all characters, while _ means find a single character. For example, if you wanted to find all queries that started with the letter M, use "M%" for Pattern. To find either DATE or DATA, use "DAT_" for Pattern.

These characters can be escaped (that is, ignored) using a \. For example, to search for a query that contains the character %, use \% in Pattern.

If Pattern is an empty string, this method retrieves all queries of the specified type (that is, specifying "" for Pattern is the same as specifying "%").

Parameters

Parameter Description

SearchType

Specify the type of search to be used with the given pattern. You can use either a constant or a number value for this parameter. See below.

Pattern

Specify the pattern to be used when searching for records.

CaseSensitive

Specify whether the search is case-sensitive. This parameter takes a Boolean value: True, the search is case-sensitive, False, it isn't.

The values for SearchType can be as follows:

Numeric Value Constant Value Description

1

%Query_FindName

Search for records with the name matching the given pattern.

2

%Query_FindDescr

Search for records with the description matching the given pattern.

3

%Query_FindNameDescr

Search for records with either the name or the description matching the given pattern.

Returns

A reference to a QueryDBRecord collection containing zero or more records.

Example

Local ApiObject &MySession, &DBRecList; 
&MySession = %Session; 
DBRecList = &MySession.SearchQueryDBRecords(%Query_FindName, "A%", False);