Skip to content
KNIME Documentation
Main Navigation Get startedBuildWork with KnimeAccount and adminRelease notesDeveloper tools
Community Hub
DevelopersKnime
Sidebar Navigation

Getting Started

Installation

User Guide

Release Notes

Install Extensions

Building Workflows

Components

Flow Control

Expressions

File Handling

Deployment

Integrated Deployment

Workflow Invocation

Best Practices

Advanced Features

AI Extension

Get Started

Build an Agent

Inject context with RAG

LLM Providers

Tutorials

Summarize product reviews

Product FAQ assistant

Restaurant agent

Your first local agent

Task extractor

Reporting

Kerberos

Extensions

Database

Overview

Tutorials

Read and filter data from a database

Write a transformed dataset to a database

Concepts

Ports and Sessions

Query Generation

Type Mapping

Deprecated Framework

Connecting

Connect: Dedicated Node

Connect: File-Based Database

Connect: Generic DB Connector

Register a JDBC Driver

Install Third-Party Driver Plug-in

Drivers on Hub and Server

Kerberos Constrained Delegation

Reading and Transforming

Read Data

Transform Data Visually

Run a Custom SQL Query

Parameterize a Query

Writing and Modifying

Insert, Update, or Merge

Delete Rows

Bulk Load Data

Create and Remove Tables

Use Transactions

Reference

Connector Node Settings

JDBC Driver Reference

Deprecated Node Mapping

Migrate Deprecated Workflows

Python

Overview

Tutorials

Python Scripting Quickstart

Data App Development Using Plotly

Data Processing

K-AI Scripting Assistant

Data Type Conversion

Batch Processing

Jupyter Integration

Environment Management

Pixi Configuration

Dependency Management

Environment Persistence

Channel Mirrors & Air-Gapped Setups

Conda Migration

Alternative Configurations

Conda and Miniforge Setup

Conda Environment Propagation

Manual Python Configuration

Legacy Node Migration

Concepts

Pixi Backend Architecture

Storage Logic

Python Environments on Executors

Reference

Python Scripting API

Bundled Packages

Executor and Hub Configuration

Troubleshooting Guide

API Reference

Inputs and outputs

Classes

Views

Utility functions

R

Deep Learning

Snowflake

Google Cloud

Azure

AWS

Big Data

Big Data Admin

Big Data Secured Cluster

Databricks

Microsoft Fabric

Power BI

Tableau

Report Designer

H2O

Changelogs

Version 5.12

Version 5.11

Version 5.10

Version 5.9

Version 5.8

Version 5.7

Version 5.6

Version 5.5

Version 5.3

Extensions

Query generation ​

KNIME Analytics Platform builds SQL queries incrementally as you chain DB nodes together. No coding is required — each node contributes a fragment of SQL, and the final query runs only when a node that materializes data executes.

How it works ​

Each DB manipulation node — such as DB Row Filter, DB GroupBy, or DB Joiner — takes an incoming DB Data connection, wraps it in a subquery, and applies its operation on top. The result is a new DB Data connection containing the extended SQL query.

The query does not execute in the database until one of the following nodes runs:

  • DB Reader: executes the query and returns a KNIME data table.
  • DB Writer / DB Row Inserter / DB Updater / DB Merger / DB Loader: executes a write operation.

This lazy evaluation means intermediate nodes execute quickly and use little memory, since they only build query text, not data.

Query generation overview

Extracting the generated SQL ​

To inspect the SQL that a DB Data connection carries, connect a DB Query Extractor node. It outputs the full SQL string as a flow variable.

Subquery wrapping ​

Each manipulation node wraps the upstream query as a derived table (subquery). Some databases do not support subqueries. If you encounter this limitation, use the DB Query Reader node to execute the query directly and avoid further chaining.

Use cases ​

Visual in-database transformation ​

Chain DB Row Filter, DB GroupBy, and DB Joiner nodes to filter, aggregate, and join data inside the database before loading the result into KNIME. This keeps large datasets in the database and reduces data transfer.

Custom SQL injection ​

Use the DB Query node to modify the incoming SQL with your own statement. The upstream query is available as the placeholder #table#.

Key concepts ​

  • DB Data connection: Carries the accumulated SQL query and a preview of the result. It does not carry materialized rows.
  • #table# placeholder: Represents the incoming SQL query inside the DB Query node. It is replaced with the actual subquery at execution time.
  • Subquery flattening: An optional advanced setting that collapses nested subqueries into a single query. Disabled by default. Enable it only if your database has performance problems with subqueries or does not support them.

Next steps ​

  • Transform data visually in a database
  • Run a custom SQL query
  • Parameterize a SQL query

Related pages ​

  • DB ports and sessions
  • Connector node settings
Pager
Next pageInstallation