Content Engine query builder (Query Builder tab)

Use the query builder to create, save, and launch queries for objects and optionally to perform bulk operations on them. See Concepts: search and bulk operations for information about the query builder features.

You can run the query builder in either simple or SQL view. Each view can produce a predefined search or a search template that prompts you for search parameters. Enterprise Manager displays predefined searches with this icon: Search icon and search templates with this icon: Search template icon.

Simple view

In the simple view, you can select the class, columns, criteria, criteria grouping, timeout limits, maximum results, and description you want to use for a predefined search. You can specify actions in the Actions tab, Script tab, and Security tab are also carried out as part of the query.

Select from Table
Select the class whose objects you want to search for. For example, the Document table provides columns with attributes that describe documents. Running a search on the Document table under a specific object store enables you to find documents created in the object store.

Select the object table you want to search. The query builder displays all columns defined in the selected table in the Select Columns window.

Select Columns
Select the properties that you want to display in the results pane when the query completes its search. By default, the query builder selects the asterisk (*), which displays all properties in the search result.
Criteria
Specify up to four criteria, or conditions, for the search to use by selecting a property from the list. For each property, select a condition and a value to search for.
Criteria Grouping
Specify how to group the conditions specified in the Criteria fields. By default, the query uses AND, which requires that an object meet all conditions to be included in the query results.

SQL view

Use the SQL text window to directly enter SQL commands. By default, the SQL text window displays the SQL equivalent of any search parameters already entered in the simple view. If you are experienced in using SQL query commands, you can type in complex queries through this view.

The SQL text window displays the SQL query commands. When you first open this view, the SQL text window displays the most recently used SQL query commands. If you opened the SQL view after specifying search criteria in the simple view, the SQL text window displays the SQL commands for the selections made in the simple view. In search templates, the SQL code includes TEMPLATE_VALUE parameters for defining the criteria to prompt for when the search template is opened.

Examples

The following example shows SQL commands generated from a query created in the simple view:

SELECT [This], [Creator], [DateCreated], [CurrentState] FROM [Document] WHERE ([DateCreated] > 20010401 T000000Z AND [Creator] = 'Administrator')

All queries must begin with SELECT This, followed by the SQL commands for column definitions and search criteria.

The following example shows the SQL commands for a document search. This sample requests the report to include columns with values for the document size, creator, and ID. The search criteria specify finding documents with more than zero content or documents created by a user who logged on as Administrator.

SELECT This, ContentSize, Creator, Id FROM Document WHERE (ContentSize > 0 OR Creator = 'Administrator')

The following example shows the SQL commands for retrieving unfiled custom objects:

SELECT CustomObject.This, CustomObject.Name FROM CustomObject LEFT JOIN ReferentialContainmentRelationship rcr ON CustomObject.This=rcr.Head WHERE rcr.Head IS NULL

If you change the query in SQL view, the query builder does not attempt to create a query in the simple view to represent those changes. Moving from SQL view to simple view can cause you to lose any changes made in the SQL view.

Query Timeout Limit (seconds)

Time: Enter the number of seconds after which the query times out. The timeout value does not include the time that is required to render the results in the Search Results window. Rendering results sometimes takes longer than executing the search itself.

Maximum: This value is displayed as a read-only value in the query builder. To change the maximum value, right-click the associated object store node and click Properties. On the Query tab, enter the maximum query time limit.

Maximum Results Displayed

Enter the maximum number of results. The query stops when the number of objects in its result set reaches this number.

Description

Optional: Enter a description to help you identify the search. The description is displayed in the Enterprise Manager Saved Searches folder.