Dynamically reading table names in a query

We are reading a data from a table which is in Oracle database, I want to perform a select query on the oracle table. I want to pass the table name dynamically into the query.

Can you please help us on how to do the above in KNIME?

1 Like

Hello @SA20276736 and welcome to the KNIME forum.

I guess that you are reading from a DB Table Selector connected to an Oracle Connector node… similar to this snapshot (I’m connecting to an SQL but it is same thing).

  • image

An easy approach would be to work the table name as a variable. You can create the table name variable in a Variable Creator node (String Configuration, Single Selection Configuration nodes are other options for String variable creations)

Let the variable to control your table selection. More than that, you will get these variables available along the whole workflow; Then you can add the table source with a Constant Value Column reading from the variable as well.

  • image

BR

PS.- You can get all the system tables with a Custom Query in DB Table Selector as well, and create all the variables automatically starting from the SQL query:

SELECT *
FROM sys.Tables
3 Likes