Creating joins in the SQL Query Builder

If you select multiple columns in two or more tables in an SQL statement, you need to specify how the rows of these columns are associated in the join of the tables. You can use the SQL Query Builder to define the join conditions.

Before you begin

SQL support for joins in the SQL Query Builder is dependent on the level of support that is provided by IMS™. If you use the SQL Query Builder to create joins, the tool attempts to create the correct syntax for IMS.

The SELECT statement must be open in the SQL Query Builder, with two or more tables specified in the Tables pane.

Only related segments within the same hierarchical path can be joined.

Procedure

To create a join in the SQL Query Builder:

Create a join by dragging or by using a pop-up menu:
Method for creating a join Procedure
To create a join by dragging
  1. In the Tables pane, drag the pointer from a column in one table (first table) to the column that you want to create the join to in another table (second table).
  2. Optional: To change the join type from the default inner join, right-click the connection line and then click Specify Join Type. In the Specify Join window, select the join type, and then click OK.
To create a join by using a pop-up menu
  1. Right-click in the Tables pane, and then click Create Join.
  2. In the Create Join window, select the source table (first table) and column.
  3. Select the target table (second table) and column.
  4. Select the join type, and then click OK.




© Copyright IBM Corporation 2010, 2017.