Dynamic Input in SQL


I want to set-up an dynamic input where I can update the criteria then the SQL will auto-replaced.
For example:
Select * from A table
where year =2018
and month = 12
and location = Europe

and I just need to update the input like year, month, location in a input table then the whole SQL query will change in Knime.

I know I can do it in other analytics application but I don’t know how to do it in Knime.

Thank you in advance.

Hi UyenPham,

a lot of knime nodes support flow variables.
This could work like below. There I am creating a “year” flow variable in a String Manipulation node and then using it to filter the year colulmn in the table.
Let me know if that helped.

1 Like

Hi there @UyenPham,

welcome to KNIME Community Forum.

AS @johannes.schweig pointed out you can use flow variables. Also you can use Parameterized DB Query Reader.

Check out this workflow example:
2019_06_21_Parameterized_Query.knwf (17.3 KB)


Hi @ipazin & @johannes.schweig Thanks for your help. I will try with your advice and let you know the result

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.