Query DB
The Query DB stage allows you to use fields as parameters into a database query and return the results of the query as new fields in the dataflow.
- On the Spectrum Flow Designer Home page, click New.
- On the New Flow page, click Job, Service, or Subflow, as required and then click the corresponding blank canvas.
- Click Ok.
- In the dialog box that appears, give a name to the Flow, Job, Service, or Subflow you are creating.
- Click Ok.
- From the Palette Panel, drag the Query DB stage to the canvas.
- Drag Sources (of the records that are to be joined) to the canvas and connect their Output Port to the Query DBInput Port.
- Drag the Sinks for the stage and connect its Input Port to the Query DB Output Port.
- Click Query DB and configure the General tab as described below.
General Tab
Option | Description |
---|---|
Connection | Select the connection you want to use. The drop down displays all the connections you
have configured. To configure a new connection or edit any existing
connections, click the Manage Connections
link. It takes you to the Connections page
in the Spectrum Management Console. For details on
configuring new connections, see Connections. Note: Click the Refresh icon to update any modification,
deletion or addition to your list of connections. |
Table/View |
Specify the table to which you want to write the
data.
The fields of the selected table are displayed in the
Fields section on the right side of the page. These are
the details displayed:
|
Where |
If you want to use a WHERE statement, enter it here. Note that you should not actually include the word WHERE in the statement. The purpose of a WHERE statement is to return only the data from records that match the condition you specify. To specify a value from a dataflow field, use this syntax:
Where For example:
In this example, the query would return data from records where
the value in the table column Note: If you are querying a case-sensitive database, make sure you
enter the field name in the same format as used in the database
table. In other words, enclose the field name in quotes (") if
the field names were quoted during table creation.
Click Preview to see a preview of the data (first 50 records) based on the criteria you defined. The preview is generated in the Preview box below the input fields. Note: The preview feature in Query DB does not work if you use a
dataflow field in the WHERE statement.
Instead, you can preview the result using the dataflow
inspection tool in Spectrum Enterprise Designer.
|
Return records with no results |
Check this box if you want records whose queries return no results to still be returned by Query DB. If you clear this check box, the record will not be returned. We recommend that you leave this option checked. |
Fields |
In the Fields table, select the fields you want to include by clicking the corresponding Include box. |
Sort Tab
If you want to sort records based on the value of a field, specify the fields you want to sort on.