Looking for values in a database table
In order to search for data in a database, Kettle offers several options. The simplest situation is the one in which you need to get one or more columns from a single database table. In this recipe, you will learn how to do this by using the Database lookup step.
We will work with the Steel Wheels sample data. If you don't know about it, refer to Chapter 1, Working with Databases. Suppose that you want to look for products that match a given search term and whose prices are below a given value. This recipe shows you how to do this.
Getting ready
In order to follow this recipe, you need the Steel Wheels database.
How to do it...
Carry out the following steps:
Create a new transformation.
Drop a Data Grid step (Input category). Open it. Under the Meta tab, add two
String
items:prod
andmax_price
. Then, complete the Data tab, as shown in the following screenshot:Add a User Defined Java Expression step.
Use that step to add a String named
like_statement
. As Java...