O'Reilly logo

Talend Open Studio Cookbook by Rick Barton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Printing your input query

If your result set isn't as expected and you are struggling to understand why, then it is really useful to be able to see the query that was executed to give you the result. This recipe shows how this can be done.

Getting ready

Open the job jo_cook_ch07_0030_printInputQuery, which is a copy of the job from the previous recipe.

How to do it…

The steps to be performed are as follows:

  1. Add a tJava component.
  2. Add OnSubjobOk from tMysqlInput to tJava.
  3. Open tJava and add the following line:
    System.out.println("\nExecuted query: \n"+((String)globalMap.get("tMysqlInput_1_QUERY")));
  4. Run the job and you will see the query as it was sent to the database.

How it works…

As we have seen in other recipes, many of the Talend components will drop ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required