Kettle "Blocking data", "blocking data up to completion", "Executing SQL Script"

Source: Internet
Author: User

Each component in the kettle transformation is a parallel relationship, and the job is sequential, so you may encounter a situation where I want to perform the following steps after a step is completed. Then you can use the "blocking data" and "blocking data until the completion" of two components;
"Blocking data": This component only allows the last data of the previous step to pass, which is often used with the "Execute SQL Script" component;
"Block data until complete": This component will block all the data of the blocked step, and when the blocked step is completed, it will push all the data of the blocked step down one step.

Note: Although blocked, the steps after blocking are still running, that is, the running time is still in progress;

"Execute SQL Script":

This component is a relatively complex component, in the transformation of this component is a high-priority component, if you do not tick {execute each row} This option, then the component will only execute once, check this option then the number of executions is the previous step of the data entry If you want to implement the component only once in the last step, you can do so

Note: Do not forget to tick {execute each line} This option, the logic of this process is that when the "table output" is completed, the last data is pushed over "blocking data", and then Execute "Execute SQL Script", because the {execute each row} This option, and because "blocking data" only one data, then " Execute SQL Script "executes only once;

In addition, "Execute SQL Script" has some other options, such as {variable substitution}, etc.;
First, when you want to use the variable must be checked {variable substitution} This option, if only check this option, then the variable can only use ${variable name} such, and when the value of the variable is a string, must be added single quotation marks, such as ' ${variable name} ', otherwise it will be error;
Second, if you want to use the value of the previous step, then you must tick {execute each row},{variable substitution}, then use the variable can be used? Instead, so that you can edit the following parameters;
However, there are several situations: 1. When {bind parmaters} is checked (that is, the binding variable), you can still use the ${variable name} in this way but the string must be enclosed in single quotes, but? No matter whether the value is a string without adding single quotation marks, otherwise error;
2. If {Bind parmaters} is not checked, then? The string is required to enclose the single quotation mark; You can understand that, do not tick {Bind parmaters}, put? Value as a number to handle, when? As a field or SQL statement in a number or SQL, and the {Bind parmaters} is checked. Value as a string with single quotation marks;
3.{quotes String}, this option can only be selected with the Bind parmaters option, which is checked by adding single quotes around the replaced variable and escaping the special characters, such as the conditional value, when there is a single quote, Kettle will automatically put a single quotation mark before the single quote (on the basis of the single quotation marks on both ends), if you want to enter ' Wang in the database, then the input is like ' Wang ', the first and last single quotation marks are marked as a string, the second single quotation mark acts as an escape character, The third one is really needed text single quotation marks; , do not add single quotation marks;

Note:? is the order of the fields you edit in the {parameters} option;
If you want to use the ${parameter name}, then no matter how you choose when its value can only be used as a string must be enclosed in single quotation marks, the value can only be numbers and strings;

Kettle "Blocking data", "blocking data up to completion", "Executing SQL Script"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.