BackPrevious Topic  Next TopicNext

Queries

This topic introduces queries and how you can use the Query Editor to create queries in Designer.

Queries are a higher-level object in a catalog. The concept is similar to that of views in a database, however they are stored in the catalog file, instead of the database. In this way, a query is independent from the raw database since Report uses a mapping name that is unique instead of the table.column syntax of SQL.

Designer includes an interactive Query Editor to build queries, and helps you create your reports based on queries. You can use queries to view, change, and analyze data in different ways. When defining a query, you can place criteria or restrictions on the data to extract only the required data from the database. For example, instead of having to view all the customers of your company, you can view just the customers from Japan.

The following example shows how to create a query using the Query Editor based on the data retrieved from the SQL Server database in the previous topic.

  1. Select New Query in the New Queries or Business Views dialog box that Designer prompts after you finish adding tables from the database into the Report catalog (if the dialog box does not show up, select Resume on the Catalog Manager toolbar).
  2. In the Enter Query Name dialog box, type the name of the query and select OK.
  3. In the Add Tables/Views/Queries dialog box, expand the Connection > Tables node, the database tables that have been added into the catalog are listed. Add the tables you want to use in the query.

    Add Tables for Query

    You can also combine tables, views, synonyms, imported SQLs, stored procedures, user-defined data sources, and other existing queries into a new query. This lets you combine multiple data resources in a single query. You can also create distributed joins to set up inter-relationships between the data resources.

  4. In the Query Editor dialog box, select the columns in each table that you want to use in the new query you are creating. You can join the tables to make them interrelated.

    Query Editor

    The Query Editor dialog box provides many features for customizing a query. For example, you can filter the data to be retrieved from the database for the query. So when you build reports on the query, the returned results will be narrowed down.

    For more information about the usage of queries in Report, refer to Working with Queries in the Report Designer Guide.

  5. Select OK to create the query. Designer adds the query in the catalog and prompts what you can do next. You can create a business view based on the query or use the query to create a page report.

    Prompt to New Business View

Back to top

BackPrevious Topic  Next TopicNext