Flow Variable to set option for DB Table Writer

Hi there,

I am using the DB Table Writer component to copy some tables in our data base. It works great, but I would like to set the option if table exists (Overwrite, Append, Fail) with a flow variable. I’ve tried to set a string with the words “Overwrite”, “Append”, but I receive the following errors:

ERROR DB Connection Table Writer 3:3 Execute failed: No enum constant org.knime.database.node.connector.tablewriter.DBConnectorTableWriterExistingTableOption.Append
ERROR DB Connection Table Writer 3:3 Execute failed: No enum constant org.knime.database.node.connector.tablewriter.DBConnectorTableWriterExistingTableOption.Overwrite

Can someone help me to understand what values the variable should be to trigger the respective action?

Thanks
Marcel

I read source code that throws the Exception.

  OVERWRITE(
            "Overwrite", "Overwrite the table, replacing data"),
  APPEND(
            "Append", "Append the table with new data"),
  FAIL(
            "Fail", "Fail execution if table exists");

You have to write OVERWRITE, APPEND or FAIL, uppercase!

Bye bye!

4 Likes

Hi there,

you can also check which value certain configuration actually has by creating flow variable like this:

FlowVariValue

This will create TableExists flow variable after node execution and will have one of above mentioned values.

Br,
Ivan

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