# DQL View

In the DQL View, you can execute single DQL queries.

![The DQL View](https://content.gitbook.com/content/Yffe42hx9CVnT3x1mJXJ/blobs/RdoxKosbLeStkaPlKReu/The%20DQL%20View.PNG)

**To execute a DQL query**, do one of the following:&#x20;

* Press F9 or Shift+Enter.&#x20;
* Go to the ***Edit** men&#x75;**>Run.***&#x20;
* Click **Run** on the context menu.&#x20;
* Click the **Run** button <img src="https://content.gitbook.com/content/Yffe42hx9CVnT3x1mJXJ/blobs/KPdcu4gn0W5hUJpN7XEm/Run%20button.png" alt="" data-size="line"> on the toolbar.&#x20;

**To stop a running query**, click the **Stop** button <img src="https://content.gitbook.com/content/Yffe42hx9CVnT3x1mJXJ/blobs/a8NATAZpoMWzp8T9Lj1K/Stop%20button.png" alt="" data-size="line"> on the toolbar.

**Other actions you can perform in the DQL View**:

* Double-click a cell in the result grid to copy the value on the clipboard. Press Ctrl when double-clicking to insert the cell value into the code editor at the current cursor position.\
  The latter can also be performed on the result grid's column headers to insert the respective column names as attribute names at the cursor position.
* Click and hold the left mouse button for 1 second on any value representing a valid Documentum `r_object_id` to load the respective object into the Object Navigator (see [object-navigator](https://docs.dqman.com/opentext-documentum-edition-24.2/object-navigator "mention")).
* Double-click the messages in the status bar to copy them to the clipboard. Move the mouse cursor over the status bar to display the current message in a tooltip, if it does not fit into the message bar area.
* You can see information about the latest executed action and the query result in the **Messages** area.

The status bar displays the complete execution time of the query, including the transfer of the query results to dqMan. The pure server response time without data transfer is labeled as **Server response time**.

#### Work with DQL Queries

You can enter one or several DQL queries in the SQL Query input area. When executing the query, all the content in the input area is regarded as one query and transferred to the Documentum server for execution. However, if only a part of a query is selected, then only this part is executed.

Use semicolons as separators for two or more queries. Setting the text cursor on one query selects this query for execution.

Moreover, you can add comments. Every line beginning with the **#** or **//** characters is regarded as a comment line.

### Syntax assistance

A number of syntax assistance functions supports the creation of DQL queries:

* **Command syntax**: Click a DQL command and wait for the hint to view the correct command syntax.
* **Function syntax**: The syntax of functions, such as *Dateadd*, *Datediff* and so on, is displayed automatically while typing the DQL command. You can activate syntax assistance by pressing F1 on your keyboard.
* **Auto completion**: Several dynamic values, such as object names, group names and so on, or allowed function values are faded in automatically in the form of a selection list. You can copy the values from selection lists by pressing **Enter**.

You can manually activate the selection list anywhere in the command area by pressing Ctrl+Space. The list is filled context dependent with the likely values at the current position. If none of the pre-defined lists applies, the list is filled with the possible attribute names.

Some of the selection lists are read dynamically from the repository when opening the session. The values in these lists can be subject to changes by other activities that will not be recognized by dqMan. In this case, you can reload and refresh the lists by clicking ***Session** menu>**Refresh Valuelists***.

#### Query by Label

In the DQL View, you can use queries the attribute labels of any locale instead of the original attribute name. dqMan will replace labels with the attribute names at execution. Attribute labels must be placed in square brackets within the query.

`Select r_object_id,object_name,[ACL Name],[Application type]`\
`from dm_document where …`

### Results list&#x20;

The **Results** list contains the results of the DQL queries.

Use your mouse to resize the columns and rows and reposition the columns in the **Results** list.&#x20;

**To search through the entire table**, go to ***Edit** men&#x75;**>Search***. Typing one or several initial letters within one column will scroll to the first matching value.

You can right-click the desired **Results** list column head and select to sort it alphabetically. Clicking an item to scroll the column into the visible range of the list.

On the data area, a list of functions is faded in for object processing. Available functions are:

**Edit** \
Starts the Results List Inline Editor. (!!!Make this a hyperlink: 3.1.5 The Results List Inline Editor!!!)

**Copy** \
This function copies the selected values to the clipboard. Rows will be separated with a linefeed and a carriage return character; columns will be separated with tabs.

**Copy with Header** \
This function copies the selected values to the clipboard, including the header names of the selected columns in the first line. Rows will be separated with a linefeed and a carriage return character; columns will be separated with tabs.

**Duplicate** \
Duplicate copies all selected values in a separate data grid.

**Add to compare list**\
The selected objects are added to the **Object Compare** list.

**Sort** \
Sorts the result data ascending or descending by the selected column.

**Goto...** \
Enables the fast change to a line or a column for the **Results** list. Entering a number enables vertical scroll, entering a column header or selecting one from the will enables horizontal scroll.

**Marks** \
Used to select different objects in the **Results** list. You can toggle or scroll marks to the next or previous marked object. Marks are mainly used by the Compare Data function, but can also be set manually.

**Object functions** \
Thisis where user-defined functions for objects in the **Results** list are provided, such as Change ACL, Dump Object, Last SQL statement, Request PDF rendition and so on. You can manage object functions in the Options Dialog. Object functions are available depending on the selected type of document and the individual configuration.

**Export to** \
Exports the selected cells of the **Results** list to CSV or Microsoft Excel (you need to have Excel installed to be able to export to this format). If the amount of exported data exceeds the Excel limitations of 65535 lines and 256 columns, more than one Excel tab sheet will be used. You cannot export data to Excel if a remote Office 365 installation is used; if this is the case, use the **Copy with Header** command.

**Generate Script**\
Opens the Script Generator that lets you generate DQL or API scripts from the selected data. Additional type dependent script templates will also be available, if the appropriate object type is selected.

**Plugin Functions** \
If dqMan Plugins that supply object related functions are installed, these functions will be displayed at the end of the context menu.

### Results List Inline Editor

You can edit values directly in the **Results** list, if the results contain the `r_object_id` attribute.\
Press Enter to save any changes. \
Pressing Esc or moving the focus to any other control will close the editor without saving.

**Single Attributes**\
For single attributes, a standard input field will be created in the corresponding cell of the grid.\
Some attributes display a list with possible values. This list is filled in either with the values of a data dictionary value assistance or with manually configured values from the file *dqManValuelists.xml*.

**Repeating Attributes**\
You can modify Repeating Attributes within a small sub grid. As DQL results do not show the correct order of repeating attribute values, the contents of this list can differ from the displayed values in the **Results** list. The sub grid offers an own context menu for inserting, deleting or reordering values of the repeating attribute.

**Multiple Single Attributes**\
If the **Results** list contains more than one result, you can edit a single attribute of multiple objects simultaneously. Select more than one value in a column and start the editor. The values you enter are applied to all the selected objects.

**Linked Repeating Attributes**\
You can modify linked repeating attributes of one object such as `r_accessor_name`, `r_accessor_permit` and `r_accessor_xpermit` of `dm_acl` in a multicolumn sub grid. Select more than one column of repeating attributes and start the editor.

**Multiple standalone or linked repeating attributes**\
You can also modify standalone or linked repeating attributes of more than one object at the same time, if the selection is extended to more than one object (line) in the result grid. The values you enter are applied to all the selected objects.0

### Attribute Filter

You can filter query results by the queried values using the attribute filter, which can be open for each column. You can combine filters and use them for multiple columns using an “and” operation.

To open an attribute filter for a column, click the button in the column header and then, in the filter dialog box, you can see the filter options depending on the column data type.

Click **Apply Filter** to activate the filter after selecting the filter options. If a filter is active, the filter button in the column header and the row numbers are highlighted.

Additionally, all filter buttons in column headers have a context menu.

<table><thead><tr><th>Function</th><th>What It Does</th><th data-hidden></th><th data-hidden></th></tr></thead><tbody><tr><td><strong>Modify Filter</strong></td><td>Opens the filter dialog box.</td><td></td><td></td></tr><tr><td><strong>Clear Filter</strong> </td><td>Clears the selected filter and updates the list.</td><td></td><td></td></tr><tr><td><strong>Filtered Columns</strong> </td><td>Displays the list of all active filters in the list. Select a column to scroll the list down to the corresponding column.</td><td></td><td></td></tr><tr><td><strong>Show marked objects only</strong> </td><td>Limits the filter to the marked objects, for example after using Compare Data function.</td><td></td><td></td></tr><tr><td><strong>Clear all OTHER Filter</strong> </td><td>Clears all other filters except for the selected one.</td><td></td><td></td></tr><tr><td><strong>Clear ALL Filter</strong> </td><td>Clears all filters.</td><td></td><td></td></tr></tbody></table>

If at least one filter is active, the top left cell of the result grid also displays a filter button with an active context menu with one additional function: “Generate Predicate”. Executing this function generates a predicate (part of a "where" clause) from the current filter settings and copies it into the clipboard, enabling you to add it to the current query to replace the filter settings. Example:

`(Upper(object_name) like 'DM%') and`\
`(globally_managed in (0)) and`\
`(acl_class < 3)`

### Message Area

The Message Area logs the executed DQL commands and their results. The context menu offers some settings to influence the behavior:

<table><thead><tr><th>Function</th><th>What It Does</th><th data-hidden></th></tr></thead><tbody><tr><td><strong>Copy</strong> </td><td>Copies selected text to clipboard</td><td></td></tr><tr><td><strong>Clear</strong> </td><td>Clears message Area</td><td></td></tr><tr><td><strong>Word Wrap</strong> </td><td>Toggles word wrap <code>on/off</code></td><td></td></tr></tbody></table>

Settings:

<table><thead><tr><th>Function</th><th>What It Does</th><th data-hidden></th></tr></thead><tbody><tr><td><strong>Auto Clear Log</strong></td><td>Clears the Message Area before executing a query (this setting is ignored for auto repeated query).</td><td></td></tr><tr><td><strong>Log Query Results</strong> </td><td>Besides messages, DQL results will also be logged in the Message area. </td><td></td></tr><tr><td><strong>CSV Format for Query Results</strong> </td><td>Results of DQL queries will be logged in CSV format.</td><td></td></tr><tr><td><strong>Fixed Width for Query Results</strong> </td><td>Results of DQL queries will be logged as list with fixed width. Values can be truncated if too long.</td><td></td></tr></tbody></table>

You can activate the Message Area from the View menu.

### Describe command

You can enter the Describe command in the DQL input window and it displays all attributes and selected characteristics for an object type.

**Syntax**:

`Describe <type> [all|custom] [with name='<name>'][,locale=’<locale>{,<locale>}|all’]` \
`Describe <table> [name='<identifier>']`

**Arguments**:

<table><thead><tr><th>Function</th><th>What It Is</th><th data-hidden></th></tr></thead><tbody><tr><td><strong>&#x3C;type></strong></td><td>Object type, such as <code>dm_document</code>, <code>dm_acl</code> or custom types.</td><td></td></tr><tr><td><strong>[all|custom]</strong></td><td><code>all</code> lists all attributes including all inherited ones. <code>custom</code> lists all customized attributes, including parent objects. If no argument is supplied, only the type related attributes will be listed.<br>(Available for object types only)</td><td></td></tr><tr><td><strong>&#x3C;table></strong></td><td>Name of a registered table, such as <code>dm_dbo.dm_queue</code> or <code>dm_queue.</code></td><td></td></tr><tr><td><strong>name='&#x3C;name>'</strong></td><td>Part of or complete attribute name and/or column name. Wildcards are "*" or "%".</td><td></td></tr><tr><td><strong>locale=’locale’</strong></td><td>Locale name for the attribute labels. Multiple locales can be separated by comma. <code>locale=’all’</code> displays all attribute labels of all available locales.<br>(Available for object types only)</td><td></td></tr></tbody></table>

You can modify attribute labels directly in the **Results** list, using the edit function from the context menu. Changed labels are published immediately. To delete labels, simply enter an empty value; in this case, the inherited label from the supertype is displayed.

Examples:

<table><thead><tr><th>Function</th><th>What It Does</th><th data-hidden></th></tr></thead><tbody><tr><td><strong>Describe <code>dm_acl</code></strong></td><td>Lists all <code>dm_acl</code> type attributes.</td><td></td></tr><tr><td><strong>Describe <code>dm_acl all</code></strong></td><td>Lists all <code>dm_acl</code> type attributes, including inherited attributes.</td><td></td></tr><tr><td><strong>Describe <code>dm_document</code> custom with <code>name='i_%'</code></strong></td><td>Lists all customized <code>dm_acl</code> type attributes that begin with the characters „i_”.</td><td></td></tr><tr><td><strong>Describe <code>dm_dbo.dm_queue</code> with <code>name='a%'</code></strong></td><td>List column definitions of the registered table <code>dm_queue</code> that begin with the character “a“.</td><td></td></tr></tbody></table>

The Describe command is also available from the context menu of the input area. The function is activated if the context menu is open on the name of an object type or a registered table. This call corresponds to the `Describe <type or table> all` command.

**Describe options**:\
The **Describe** options enable you to customize the columns and their order of the describe **Results** list. Available columns are predefined and you can select them by selecting the respective checkbox. Moving columns upwards or downwards alters the default order.

The column “owner” is only displayed if the argument `all` or `custom` is used and attributes from different type levels in the hierarchy are displayed. In this case, also the type `owned` attributes can be marked by selecting the **Mark owned attribute labels** checkbox. This functions gives a good overview whether a type uses the inherited label or overwrites it with own values.

### Template Queries <a href="#toc88299522" id="toc88299522"></a>

Template Queries are DQL queries that contain placeholders for values. When executing a Template Query, you need to enter values for the placeholders.

Placeholders consist of a freely selectable name, enclosed by { } characters. You can insert placeholders either manually or with a function available in the context menu of the input window. Template Queries can contain any number of placeholders.

If placeholders appear in a query more than once, they always represent the same value. &#x20;

{% hint style="info" %}
Placeholder names are case sensitive!

Also, if for any reason an opening curved clip is needed in the DQL query for another purpose than for beginning a placeholder, mask it with a double opening curved clip, like **… where `object_name` like ‘{{%**’.
{% endhint %}

You can improve the behavior of placeholders by adding placeholder options, using the **Edit template field** option from the context menu.&#x20;

<table><thead><tr><th width="179.83340927731706">Name</th><th>Function</th><th data-hidden></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>Name of the placeholder</td><td></td></tr><tr><td><strong>Label</strong></td><td>Caption displayed in the input dialog. If no label is available, the name will be displayed.</td><td></td></tr><tr><td><strong>Default Value</strong></td><td>The default value displayed in the input control. It remains valid until entering or selecting another value.</td><td></td></tr><tr><td><strong>Mandatory</strong></td><td>Select this checkbox if the field is mandatory.</td><td></td></tr><tr><td><strong>Use cached query</strong></td><td>If selected, the result of the DQL query used to fill the value assistance will be cached to improve performance, but will ignore the changes to the underlying values. Select <strong>Refresh Value lists</strong> from the <strong>Session</strong> menu to clear the cache.</td><td></td></tr></tbody></table>

Various types of value lists are available in **Value List Type**, as follows:&#x20;

<table><thead><tr><th>Name</th><th>What It Does</th><th data-hidden></th></tr></thead><tbody><tr><td><strong>None</strong></td><td>No value list.</td><td></td></tr><tr><td><strong>Fixed List</strong></td><td>A list with fixed values that must be predefined in the control <strong>Values</strong>.</td><td></td></tr><tr><td><strong>DQL Query</strong></td><td>A DQL query that fills in the list dynamically.</td><td></td></tr><tr><td><strong>Date Picker</strong></td><td>Displays a date picker control.</td><td></td></tr><tr><td><strong>File Open Dialog</strong></td><td>Opens a <em><strong>File>Open</strong></em> dialog box. You can define a list of available file types in the control <strong>Values</strong>.</td><td></td></tr><tr><td><strong>Directory Selector</strong></td><td>Enables you to select a directory from the local file system.</td><td></td></tr><tr><td><strong>Cabinet/Folder Selector</strong></td><td>Enables you to select a cabinet or folder from the currently connected repository.</td><td></td></tr></tbody></table>

If the result of a DQL query contains more than one attribute, the value of the first column will be displayed in the value list and the corresponding value of the second column will be inserted in the query.

In a fixed value list, you can make a distinction between the displayed value and the inserted value using the || separators (for example, *Label||Value*).

The query `Select object_name`, `r_object_id from dm_document`will fill the list with the `object_name` attribute of all `dm_document` objects. Selecting a name from the list returns the `r_object_id` for the placeholder value.

Using **Check Syntax**, you can verify the syntax of the current DQL query. This feature is only available, if a valid session exists.

#### Formating DQL Queries

You can format DQL queries automatically. The associated format templates are defined in the file *dqManFormatTemplates.xml*.

To format a query, click on the query in the DQL input area and select the function **Auto Format Query** from the context menu of the DQL input area.

&#x20;**The Query**:

`Select r_object_id, object_name, acl_name from dm_document`\
`where object_name like 'dm_%' or object_name like 'xy_%' order by r_object_name, acl_name`

**Will be formatted to**:

`SELECT`\
&#x20; `r_object_id,`

&#x20; `object_name,`

&#x20; `acl_name`

`FROM`

&#x20; `dm_document`

`WHERE`

&#x20; `object_name like 'dm_%' or`

&#x20; `object_name like 'xy_%'`

`ORDER BY`

&#x20; `object_name, acl_name`

To clear the formatting of a query (unformat), use the **Unformat Query** function from the context menu. Calling this function removes all tabs, multiple spaces, line feeds and carriage returns from the query, leaving a plain single line query.

The third formatting function *Extract Query* can be used to extract the DQL part out of a piece of program code. From this code:

`String query = "Select * from pl_produkt (all) where i_chronicle_id = '" +`\
&#x20;              `chronicle_id + "' and " +`\
&#x20;              `"valid_from <= Date (Today) and " +`\
&#x20;              `"Dateadd(day,1,valid_to) > Date(Today) and " +`\
&#x20;              `"any r_version_label = '_NEW_'";`

&#x20;This query will be extracted:

`Select * from pl_produkt (all) where i_chronicle_id = '' and valid_from <= Date (Today) and Dateadd(day,1,valid_to) > Date(Today) and any r_version_label = '_NEW_';`

Note that the variable `chronicle_id` is removed, leaving an empty value to be filled `…where i_chronicle_id = '' and…`

#### Repeated Queries

DQL queries can be executed repeatedly and automatically in a selectable or freely definable interval, causing the results to be refreshed accordingly.

The function is available in the context menu of the DQL editor. (*Repeat Query every…).* After selecting the interval, a yellow notification bar is displayed at the top of the DQL editor counting down to the next query execution. Automatic execution can be stopped at any time by selecting **Stop Repeat Query** from the context menu or from the notification bar.

In case of automatic execution the message area will not be deleted and will display the full log containing all the executions.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dqman.com/opentext-documentum-edition-24.2/session-window-dql-api-dql-script-api-script/dql-view.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
