Create and remove database tables
Use DB Table Creator to create a new table in a database, and DB Table Remover to drop an existing one.
Before you begin
- Establish a database connection. See Connect to a database using a dedicated connector node.
Create a table with DB Table Creator
The DB Table Creator node creates a new database table. Define the structure manually, or derive it dynamically from an input KNIME table.
- Connect the DB Connection output port to a DB Table Creator node.
- To derive the structure from a KNIME table, connect the table to the second input port.
- Click the node once to open its configuration.
- In the Settings tab, enter the Schema and Table name, and configure the following options:
- Create temporary table — creates a table that exists only for the duration of the database session.
- Fail if table exists — fails with an error if a table with the same name already exists. If disabled, the node succeeds without creating a table when the name is taken.
- Use dynamic settings — derives column names and types from the input KNIME table. When enabled, the Columns and Keys tabs become read-only previews.
- In the Columns tab, define or review the column names and SQL types.
- In the Keys tab, define or review primary and unique key columns.
- If Use dynamic settings is enabled, configure type and key rules in the Dynamic Columns Settings and Dynamic Keys Settings tabs:
- Name-Based SQL Type Mapping — maps columns by name pattern (string with wildcards or regular expression) to a SQL type. Takes precedence over type-based mapping.
- KNIME-Type-Based SQL Type Mapping — maps all columns of a given KNIME type to a SQL type.
- Optionally, add SQL to the Additional Options tab to append after the
CREATE TABLEstatement. - Click Apply and Execute.
TIP
Wildcards supported in name patterns: * matches any number of characters, ? matches exactly one character. For example, KNI* matches all strings starting with KNI.
Remove a table with DB Table Remover
The DB Table Remover node drops a table from the database. This is equivalent to executing a SQL DROP statement.
- Connect the DB Connection output port to a DB Table Remover node.
- Click the node once to open its configuration.
- Enter the Schema and Table name, or click Select a table to choose from the Database Metadata Browser.
- Configure the following options:
- Cascade — also removes dependent tables and views that reference the dropped table. Ignored if the database does not support it.
- Fail if table does not exist — fails if the selected table does not exist. If disabled, the node succeeds even when no table is found.
- Click Apply and Execute.