Export table to DB from metadata "Spec" view

Hello,

I would like to have the same structure with the view “Spec” with metadata and possible values from the domain in a View for DB import.


How can I do it?
Thank you,

Szilvia

Hi.
Have a look at the “Extract Table Spec” node. The table structure output of this node is, however, slightly different than in the screenshots you show. For example, the domain (i.e. possible) values are given in a collection column. Hope this helps.
-Don

4 Likes

Hi @szroman , the “Extract Table Spec” node allows you to get what you have in the Spec view as a table.

For example:

However, if you want to import this to a DB, you will then have to manually come up with the CREATE TABLE statement, which is still doable with some concatenation and string manipulation. Depending on what DB system you use, the CREATE TABLE statement could vary.

Alternatively, you can have Knime write to your DB directly. Knime is able to create the table for you. It will create and run the CREATE TABLE statement for you. It will know how to generate the CREATE TABLE statement based on the driver that you choose for your DB Connector.

One example is the DB Table Creator node, and can be used as follows:
image

You just need to link the original table to the DB Table Creator, and of course it needs a DB connection.

And here is the configuration options from the DB Table Creator:

As you can see, Knime will set up the columns and their types automatically, and create the table with these columns.

4 Likes

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