Describing and Accessing Data: Overview
Introduces data source descriptions and explains how to use them.
Developer Workbench provides a set of graphical tools that you can use to describe and access many types of data sources, including:
- Relational, such as DB2.
- Multi-dimensional, such as SAP BW and Essbase.
- Procedures, such as Web Services and CICS® Transactions.
- XML, such as XML and Tamino.
- Hierarchical, such as IMS™ and FOCUS.
- Sequential, both fixed-format and free-format.
- Indexed, such as ISAM and VSAM.
- Network, such as CA-IDMS.
- Other popular data sources, such as Lotus Notes® and LDAP.
These graphical tools are designed to:
- Translate the schema of the data source into metadata that DB2® Web Query can read and report against.
- Optionally, enable you to customize and enhance the generated metadata, without having to know the subtleties of the underlying DB2 Web Query data description language.
Parent topic:
IBM DB2 Web Query for System i Overview
A Note About Data Source Terminology
Different types of data sources make use of similar concepts, but refer to them differently. For example, the smallest meaningful element of data is called a field by many hierarchical database management systems and indexed data access methods, but called a column by relational database management systems.
There are other cases in which a common concept is identified by a number of different terms. For simplicity, we have standardized on a single set of terms. For example, we usually refer to the smallest meaningful element of data as a field, regardless of the type of data source. However, when required for clarity, we use the term specific to a given data source. Each time we introduce a new standard term, we define it and compare it to equivalent terms used with different types of data sources.
How Applications Interpret Data
When your application accesses a data source, it needs to know how to interpret the data that it finds. To accomplish this it reads a synonym, which is a term for the generated metadata associated with the particular data source.
Your application needs to know about:
- The overall structure of the data. For example, is the data relational, hierarchical, multi-dimensional, sequential? Depending upon the structure, how is it arranged or indexed?
- The specific data elements. For example, what fields are stored in the data source, and what is the data type of each field—character, date, integer, or some other type?
The synonym provides an alias for the data source that tells the server how tables are described and where to find them.
The primary component of a synonym is a Master File. The Master File describes the structure of a data source and its fields. For example, it includes information such as field names and data types.
For some types of data sources, an Access File supplements the Master File. An Access File includes additional information that completes the description of the data source. For example, it includes the full data source name and location. The nature of the information in the Access File is specific to each data source. You need one Master File—and, for some types of data sources, one Access File—to describe a data source.
How to Obtain a Synonym
You can generate synonyms using the Metadata menu option in Web Query, which enables you to explore DBMS catalogs and select the objects for which you wish to create synonyms. The tool prompts for all the information it needs to create a synonym for a particular data source and stores the generated synonym on the server.
There are some prerequisites: be authorized to use the data against which you plan to report and have configured an adapter to access that type of data. In fact, when you begin to create a synonym, Developer Workbench opens the adapter configuration window. The option to create the synonym becomes available only after the adapter is successfully configured.
Adapters are available for many data sources. Every adapter is specifically designed for the data source that it accesses, and, as a result, is able to translate between SQL or DB2 Web Query and the data management language (DML) of the data source. Adapters provide solutions to product variations, including product differences in syntax, functionality, schema, data types, catalogs, data representations, message processing, and answer set retrieval. It is the adapter that manages the synonym creation process. For related information, see How an Adapter Works.
How an Adapter Works
The adapter manages the communication between the data interface and the data source, passing data management requests to the data source and returning either answer sets or messages to the requestor. To perform these functions, the adapter:
- Translates the request to the applicable DML.
- Attaches to the targeted data source, using standard attachment calls. The adapter then passes the request to the data source.
- The data source processes the request.
- The results or error conditions are returned to the client application for further processing.
What You Can Do With a Synonym
Once you have generated a synonym, you can report against it using all of Web Query’s reporting tools. In many instances, the configured adapter and the generated synonym are all access your data and create reports and graphs.
However, you may wish to enhance the synonym in order to implement particular capabilities that are supported in the DB2 Web Query data description language. To do this, you can use a second data description tool, the Synonym Editor.
When you use the Synonym Editor, there is no need to know the data description language since the graphical tool displays all viewable and editable attributes of the synonym components. If you make changes to the generated synonym, the Synonym Editor validates your entries and displays messages if they violate the underlying syntax of the data description language.
Ways to Enhance a Synonym
Here are just a few of the attributes you might want to add to the synonym to enhance your data access and reporting capabilities. You can:
- Create a cluster Join view by linking available synonyms to create a multi-segment (multi-table) file for reporting.
- Apply security rules for fields and values to ensure that user access is based on a data source security (DBA) specifications.
- Add dimensions for OLAP analysis.
- Add virtual columns (DEFINEs) and columns for aggregated values (COMPUTEs).
- Add filters to specify data selection criteria.
- Add group definitions for data sources that support groups.
- Add meaningful titles and descriptions, including Multilanguage variations.
- Change the format of fields (for example, the size of an alpha field or the format of a date field).
- Create business views of the metadata in order to limit the fields available to any retrieval request that references the business view and to group fields together based on their roles in an application.
- Define parent/child hierarchies for cube data sources such as SAP BW and Essbase.
The Synonym Editor is fully described in Using the Synonym Editor.
How an Application Uses a Synonym
Synonyms are stored apart from the associated data source. Your application uses a synonym to interpret the data source in the following way:
- It identifies, locates, and reads the Master File for the data source named in a request.
- It locates and reads the Access File for the data source named in the request, if that type of data source requires an Access File.
- It locates and reads the data source(s).
The data source contents are interpreted based on the information in the synonym.