Defining a query with the Text Manager (OP)

In an on-premises environment, use this procedure to define the selection criteria for a stand-alone SQL query through the Text Manager. The basic query properties for the query must be defined. See Defining a query (OP).

The functionality to define and run stand-alone SQL queries is not available in a cloud environment.

Note that you can use the Text Manager to modify queries that were previously defined with Easy SQL. You can no longer maintain a query in Easy SQL, if you use one of the following in the query text.

  • An OR boolean operator
  • A BETWEEN predicate
  • A HAVING clause
  • Brackets
  • Combined fields
  • Wildcards
  • Numeric expressions
  • String expressions

To define the selection criteria for a query through the Text Manager:

Schritt 1. Start the Text Editor

In the Query Data (ttadv3580m000) session, select the new query and, on the Zusatzoptionen menu, select Text Manager. The Text Editor starts.

Schritt 2. Enter or adjust the query's source code

The syntax of the source code is similar to standard SQL. In addition, you can use references in the dictionary (REFERS TO). This allows the use of the references that are defined in the data dictionary, together with the associated fields.

The general structure of a query is:

SELECT <select list>
FROM <from list>
[ WHERE <where condition> ]
[ GROUP BY <group by list>
  [ HAVING <having condition> ] ]
[ ORDER BY <order by list> ]

For the examples the statements are written in capitals. In the Text Editor both uppercase and lowercase letters can be used.

For details and examples of the query syntax, see Query structure (OP).

Hinweis

You can start the Display Tables (ttadv3584m000) session to display a list of tables and table fields. To start this session, complete one of these steps:

  • In the Multi-line Text Editor, on the Options menu, select Start Zoomsession.
  • In the ASCII Text Editor, press <Esc><Ctrl>[Z].
Schritt 3. Save the changes and close the text editor

Depending on the Output Type of the query, you can now generate a query report or add query fields to a chart. See Defining a query (OP).

Verwandte Themen