SearchPublicQueries method: Session class

Syntax

SearchPublicQueries(QueryType, SearchType, Pattern, CaseSensitive)

Description

The SearchPublicQueries method returns a reference to a Query collection, filled with zero or more Public queries that match the specified SearchType, Pattern, and CaseSensitive choice.

Parameters

Parameter Description

QueryType

Specify the type of query to be searched for. You can specify either a constant or number value for this parameter. See below.

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 queries.

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 QueryType can be as follows:

Numeric Value Constant Value Description

1

%Query_ListQuery

Find queries of the type Query.

3

%Query_ListDBAgent

Find queries of the type Process

4

%Query_ListRole

Find queries of the type Role

10

N/A

Find queries of type Archive

The values for SearchType can be as follows:

Numeric Value Constant Value Description

1

%Query_FindName

Search for queries with the name matching the given pattern.

2

%Query_FindDescr

Search for queries with the description matching the given pattern.

3

%Query_FindNameDescr

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

Returns

A reference to a Query collection containing zero or more queries.

Example

The following example retrieves all public queries of type Query that start with A and does a case-insensitive search, that is, get all queries starting with A or a.

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