Printing your output query
In one of the previous recipes, we saw how we can print the input and select query for debugging. This recipe shows how this can be achieved for an update, delete, or insert, which are all functions available through tMysqlOutput
.
Getting ready
Open the job jo_cook_ch07_0050_printOutputSQL
, which is a copy of the job from the previous recipe.
How to do it…
The steps to be performed are as follows:
Add
tJavaRow
and link it totMysqlOutput
.Add the following code:
System.out.println(((String)globalMap.get("tMysqlOutput_1_QUERY")));
Run the job. You will see that the output is all null.
Open the
tMysqlOutput
component and click on the Advanced settings tab.Click the field Enable debug mode as shown in the following screenshot:
Run the job and you will see the individual SQL statements that were executed.
How it works…
Before using a tMysqlOutput
component, you must first set the Mode to Debug in the Advanced tab for the component. This will allow you to capture the query for...