Skip to main content

ExecuteSQLStatement

Description

Executes a SQL DDL or DML Statement against a database. This Processor allows Expression Language to be evaluated against FlowFile attributes in order to parameterize the SQL for each FlowFile.

Tags

database, delete, insert, jdbc, sql, update

Properties

In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Connection Pooling Service *Connection Pooling ServiceController Service:
DBCPService

Implementations:
DBCPConnectionPoolLookup
DBCPConnectionPool
HikariCPConnectionPool
SnowflakeConnectionService
The Connection Pooling Service that is used to obtain a connection to the database
SQL *SQLThe SQL statement to execute. The SQL may make use of Expression Language to reference attributes. In this case, the Processor will rewrite the
query using parameters in order to avoid SQL Injection attacks. When referencing Expression Language, the entire value must be a single Expression.
For example, INSERT INTO TABLE X (name) VALUES ('$\{name}') is valid, but INSERT INTO TABLE X (name) VALUES ('Mr. $\{name}') is not because
Expression Language is used within a String value. The SQL may also reference ${flowfile_content} in order to reference the content of the FlowFile
as UTF-8 encoded text.

Supports Expression Language, using FlowFile attributes and Environment variables.
Max Batch Size *Max Batch Size1The maximum number of FlowFiles to process in a single batch
Max Content Reference Size *Max Content Reference Size32 KBIf the SQL property references ${flowfile_content}, this property specifies the maximum size of the FlowFile that is allowed to be read into memory. If the FlowFile is larger than this value, the FlowFile will be routed to failure. If the SQL property does not reference ${flowfile_content}, this value has no effect.

Dynamic Properties

This component does not support dynamic properties.

Relationships

NameDescription
failureThe SQL statement could not be executed
successThe SQL statement was successfully executed

Reads Attributes

This processor does not read attributes.

Writes Attributes

This processor does not write attributes.

State Management

This component does not store state.

Restricted

This component is not restricted.

Input Requirement

This component requires an incoming relationship.

System Resource Considerations

This component does not specify system resource considerations.

See Also