Build Dynamic Query Based on Table Structure

I know this is probably quite late, but wanted to see if someone can respond:
So my requirement is that I have a table with say three columns: IDENTITY_1, IDENTITY_2, IDENTITY_3, coming from one server/database and i have to use these to poll another database/server that is of a completely different type (SQL Server to Teradata or some such). The thing is that in the second server, the query would be

Where IDENTITY_1 IN ()

so in essence, I have to build a dynamic query to poll the second server/database from the data pulled from the first query. How do you suggest I can achieve that? am looking for info and will post here if I find something but would greatly appreciate if I get any suggestions.

Hi @ak2020 and welcome to the community!

In terms of dynamically building parts of a database query, take a look at this workflow on the hub, which might provide some ideas. Feel free to ask further regarding specific issues or further assistance.


hI @takbb , thank you for the workflow. The challenge I have is that the database one is a SQL Server so I would have to either make it a view and do a custom query. I have a stored procedure which I thought was useful. The alternative I found was to bring a subset of the other database’ data and then use Knime join/filter/other things to finetune. Since the data I will be dealing with is not huge, it shouldn’t be a load on the Knime server for the admin to yell at me. The databases we use have a lot of restrictions for obvious reasons, hence this jugglery.

Thank you once again!

1 Like

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