Adding parameters to your queries

One of the ways you can make your queries more flexible is by passing it some parameters. For example, suppose that you want to list the films that belong to a given category and you have that category in a properties file. If the category in your file is Comedy, the query to run will look as follows:

SELECT f.title FROM public.film f JOIN public.film_category fc ON f.film_id = fc.film_id JOIN public.category ca ON fc.category_id = ca.category_idWHERE ca.name = 'Comedy';

In your Transformation, you want to replace Comedy with a parameter, so the category changes according to the content of your file. This is done in two parts:

  • You have to prepare a stream with the parameter(s) that the query will receive ...

Get Learning Pentaho Data Integration 8 CE - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.