Writing a simple file
In this recipe, you will learn the use of the Text file output step for writing text files.
Let's assume that you have a database with outdoor products and you want to export a catalog of products to a text file.
Getting ready
For this recipe, you will need a database with outdoor products with the structure explained in Appendix, Data Structures.
How to do it...
Carry out the following steps:
Create a new transformation.
Drop a Table input step into the canvas. Enter the following SQL statement:
SELECT innerj.desc_product, categories.category, innerj.price FROM products innerj INNER JOIN categories ON innerj.id_category = categories.id_category
From the Output category, add a Text file output step.
In the Filename textbox under the File tab, type or browse to the name of the destination file.
In the Extension textbox, leave the default value
txt
.Check the Do not create file at start checkbox. This checkbox prevents the creation of the file when there is no data to write to it...