SearchPrivateQueries method: Session class
Syntax
SearchPrivateQueries(QueryType, UserId, SearchType, Pattern, CaseSensitive)
Description
The SearchPrivateQueries method returns a reference to a Query collection, filled with zero or more Private queries that match the specified SearchType, UserId, 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. |
|
UserId |
Specify the user Id to be used to find currently signed-on user’s private queries. |
|
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_Query |
Find queries of the type Query. |
|
3 |
%Query_DBAgent |
Find queries of the type Process. |
|
4 |
%Query_Role |
Find queries of the type Role |
|
10 |
N/A |
Find queries of the 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 private queries of type Query which start with A and do a case-insensitive search, that is, get all queries starting with A or a.
Local ApiObject &MySession, &DBRecList;
&MySession = %Session;
DBRecList = &MySession.SearchPrivateQueries(%Query_ListQuery, %UserId, ⇒
%Query_FindName, "A%", False);