Parameterized DB Query Reader

This node runs SQL queries in the connected database restricted by the possible values given by the KNIME input table. It restricts each SQL query so that only rows that match the possible values from the input table are retrieved.

Options

Settings

SQL Statement
Enter the SQL-like query here, for example SELECT * FROM table. If the table place holder isn't changed, then it will be replaced with the query from the database input port. Constant values and any identifier from the database column list, column list and flow variable list can be used in the SQL statement by double clicking the column or variable name.
To open code completion press <CTRL> + <SPACE>. Table and columns names are only suggested if the metadata is available e.g. shown in the Database Metadata Browser. To perform undo press <CTRL> + Z and for re-do <CTRL> + Y.
Database Metadata Browser
The Database Metadata Browser allows you to browse the database metadata and to select a table or view. Click the Refresh button at the bottom right to re-fetch the metadata from the database. The data is grouped by database schema and type e.g. view or table. By clicking on an entity it shows contained elements. If you click on a table or view the dialog will fetch the column names and types of the selected element. To select a table or view select the name and click OK or double click the element. To search for a particular table or view enter the name or parts of the name into the search field and click on the Magnifying Glass button or press enter.
Database Column List
The list contains the columns that are available in the input DB Data object. Double clicking any of the entries will insert the respective identifier at the current cursor position (replacing the selection, if any).
Column List
The list contains the columns that are available in the KNIME input table. Double clicking any of the entries will insert the respective identifier at the current cursor position (replacing the selection, if any).
Flow Variable List
The list contains the flow variables that are currently available at the node input. Double clicking any of the entries will insert the respective identifier at the current cursor position (replacing the selection, if any).
Append input columns
If checked, then the columns from the input table will be appended to the output table. Only columns that are used in the looping SQL statement will be appended.
Include empty results
If checked, then all empty results will be appended to the output table and represented as Missing Cell. All input rows will be retained.
Retain all columns
If checked, then all columns including columns that are not used in the looping SQL statement will be appended to the output table.
Fail on error
If checked, then the node will fail if there is any error. Otherwise, the node will continue executing and all errors will be collected in the second output table.

Input Type Mapping

This tab allows you to define rules to map from database types to KNIME types.

Mapping by Name
Columns that match the given name (or regular expression) and database type will be mapped to the specified KNIME type.
Mapping by Type
Columns that match the given database type will be mapped to the specified KNIME type.

Output Type Mapping

This tab allows you to define rules to map from KNIME types to database types.

Mapping by Name
Columns that match the given name (or regular expression) and KNIME type will be mapped to the specified database type.
Mapping by Type
Columns that match the given KNIME type will be mapped to the specified database type.

Input Ports

Icon
KNIME data table with possible values used to constrain the database SQL query.
Icon
DB Data that will be used during query execution.

Output Ports

Icon
KNIME data table with the result from the database and optionally the data columns from the input table.
Icon
Table with error message if any, otherwise empty table.

Views

This node has no views

Workflows

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.