SQL Statement Executor Component

The SQL Statement Executor component allows for the execution of DDL and DML statements as part of the execution of a blueprint.  The component is configured with a Resource that defines the database the statements will be executed against, and a list of statements to execute.  The statements are executed one after the other inside of a transaction.

Once all the statements have successfully executed, a SignalData is output on the success output channel.  If any of the statements fail, the entire transaction is rolled back, and an error is reported on the error output channel.  

The component is triggered either by a SignalData on the trigger input channel, or a SimpleMappedData on the queryParameters input channel.  The trigger input channel will cause the statements to be executed exactly as provided.  This is useful if the statements are fully specified and ready to execute.  The queryParmaeters input channel will use the data inside the Simple Mapped Data to do substitutions into the statements before they are executed.  The substitution process is the same as that used for the SQL Parameterized Reader.

Input Channels

trigger — Receives a SignalData Object that causes the component to execute the statements exactly as specified.

queryParameters — Receives a SimpleMappedData Object and execute the statements after substituting values into the statements.

Output Channels

success — Returns a SignalData object to indicate that the statements were successfully executed.

error — Outputs an ErrorOutput object when an error occurs communicating with the database or executing the statements.

Parameters

resource — (SQL Database Resource) The resource defining the service to which this component should connect

statements — (String) The statements to execute when the component is invoked.  Multiple statements are separated by delimiter.  The statements may include placeholders that will be replaced with corresponding values from the SimpleMappedData input before execution. The parameter uses placeholders of the form :variable  , where the name of the variable matches the name of an entry in the SimpleMappedData object received on the queryParameters input channel.

delimiter — (String, default: ";") The delimiter to use when separating the SQL statements. This is especially important in cases where statements are inter-dependent (such as when creating a table and then inserting rows into it) or for complex statements (such as those containing BEGIN and END statements). The delimiter cannot include spaces.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us