User`s guide
CHAPTER 5 Advanced Concepts and Tools
User’s Guide 47
Creating queries
The Content Explorer allows you to create queries in a convenient graphical
environment. Little or no SQL knowledge is required.
Note You can only use the Content Explorer to generate ad hoc queries, which
cannot be saved to a file or to the repository. However, if you want to save the
generated SQL for other purposes, you can copy it from the Generated Query
window that can be opened by selecting Generated Query from the View menu.
To do so, select the part of the generated query and copy it to the clipboard.
❖ To create a simple query
The following procedure uses the PRODUCTS table to generate a simple query
that retrieves all attributes from the a table.
1 Click the table or view name in the Navigation area.
2 Drag the selected object to the Design area.
3 Verify the results of the generated query by clicking View the Generated
Query.
❖ To create a query using multiple tables
The following procedure uses the PRODUCTS and the SALES table to generate
a query that retrieves joined information from two tables.
1 Click the table PRODUCTS and drag it onto the Design area.
2 Click the table SALES and drag it onto the Design area.
3 Create a join between the tables by drawing a link between the fields
PR_ID of both tables. The join can also be automatically created if you
select the Auto Join Generation option in the Preferences.
❖ To use the Auto Join Generation option
Auto Join Generation is based on identical attribute names used within tables
or views. If there are identical names and the Auto Join Generation option is
selected, the Query Designer automatically creates a join based on those
attributes.
1 Access the Preferences dialog box by selecting Preferences from the File
menu.
2 Select the Workbench | Query Designer | Auto Join Generation check box
in the Preferences dialog box.