Adding a UNION to a Data Flow

How to:

Reference:

Adding a union to a data flow lets you combine the results of two select statements into a single result set.

There are some restrictions on the select statements that can be used:

Procedure: How to Add a UNION to a Data Flow

From the data flow workspace:

  1. Right-click to the left of a SQL object and click Add Union.

    or

    Right-click a SQL, Join, or Union object, point to Add, and then click Union.

    or

    Drag the Union object from the Insert group of the Flow tab, into the workspace.

  2. A new Union object appears in the data flow. Right-click the object, select Add, and then click Union.
  3. Continue by adding objects to the select as needed.
  4. Right-click the Union object, point to Add, and then click Select (each union requires two select statements).
  5. Continue by adding objects to the second select as needed.

    Note: You can test the union by double-clicking the object and clicking the Test SQL tab to see a sample of the data.

  6. Right-click the Union object and click Properties.
  7. The Properties pane opens. Select the Union type. See Union Types for details.

Reference: Union Types

The Union object can be used to combine answer sets in different ways, depending on the type selected in the Properties pane. The different union types are:

Object

Function

Union Object

Union

Returns a result that contains all rows from both sets with duplicate rows removed.

Union All Object

Union All

Returns a result that contains all rows from both sets, including duplicates.

Except Object

Except

Returns a result set that contains all rows from the first set, excluding common rows from the second set.

Except All Object

Except All

Returns a result set that contains all rows from the first set, excluding common rows from the second set, including duplicates.

Intersect Object

Intersect

Returns a result set that contains the common rows from two result sets.

Intersect All Object

Intersect All

Returns a result set that contains the common rows from two result sets, including duplicates.

WebFOCUS

Feedback