Automation of oracle table selection

Hello,
Sorry I’m new on KNIME, my question is :

is it possible to write in a csv the name of a sql table and the fields, then recover the csv file on KNIME thanks to the adequate node, and then use a node of selection of the tables which takes in parameters the value table and fields of the csv? Or is it possible to create a form to avoid manual modifications on the workflow

@didi welcome to the KNIME forum.

Certainly such a scenario is possible. I have put together two examples. In the first one there is a simple configuration file with the necessary information being read into KNIME and used as variables to do a selection

configuration_file.txt

table_to_select: table_20
columns_to_select: "t_20_Cluster_Membership", "t_20_Universe_0_2", "t_20_Universe_1_1"

If you want to do a more interactive selection you could use Components to create an interactive experience (and later also run that on a KNIME server :slight_smile: ).

In two steps you would first provide the user with a list of tables from your database where he might select one. You just have to apply the results of the selection and continue the workflow.

In the next step you dynamically provide a list of the columns and let them select the ones they want.

An SQL code is being provided that would do what you want.

You could try this example and toy around with it.

components can at first glance seem a little scary but once you start using them you can see how fast you can build small applications without much code or no code at all. A look inside the second component:

7 Likes

Thank you ! I will try it

1 Like

Hey @mlauber71, i use your examples and its work perferctly, thank you so much. I have another question, is it possible to make the same workflow to configure the connection with the database, because when i try to use flow variables or component i got the same error “Errors overwriting node settings with flow variables”

@didi glad you liked the example. Could you explain in more details what you want to do.

First it might make sense to familiarise yourself with the concept of components. Especially how they handle flow variables.

https://docs.knime.com/latest/analytics_platform_components_guide/index.html#introduction

Maybe you could set up an example with a local database or give us more details about your problem.

I have a file .txt named “passeword” where i put elements for authentication to the database like this :

  • username = “didi”
  • password = “1234”
  • hostname : develop
  • databasename : exmple-develop
  • port : 1 000

Then I used the same method as for configuring the table selection, i used flow variables:
image

I found a solution i didn’t know that i just have to use a variable to credentials :grin:, i’m so happy !!

3 Likes

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