To read an SQL table use the step Table input
, and copy paste your query into the big text area.
Note that, unless you have complex join in your query, you rarely have to import sql scripts thanks to a very handy Get SQL Statement
button.
Start with a select statement without parameters. Once it works, replace the variables with ${variable}, and tick the Replace variable in script
check box. (Warn there are some restrictions due to java SQL Prepared Statement, for example you may not have a variable in the table name).
If you want to get the script from a file, first read the file with a Table input
in a column and select this column in the Insert data from step
of the Table input
.
If you still have variable parameters either in your file, either in the name of the tables you are selecting from, then use a Modified Javascript
or a Regex evaluator
, or any other step to replace the variables with they value, and give the resulting SQL script to the table via the Insert data from step
.
If you have a bunch of file.sql to read, do not forget to check the Execute for each row
button.
Hope this helps.