Database alter rename table

Hello,

I am working with a Postgres database and I need to rename a table.
I thought to use the following SQL statement “ALTER TABLE IF EXISTS table1 RENAME TO table1;”.

Is there a Knime node that I can use to perform this statement and any other similar database table manipulation statements ?

Thank you for your help.

Best regards,

Claude.

1 Like

Hey @claudeostermann,

I believe the DB SQL Executor is the most appropriate node for your use case.

Cheers,

@sjporter

5 Likes

Hi @claudeostermann , the DB SQL Executor suggested by @sjporter would be the correct node to use.

You can execute any SQL statement via this node, including the rename of table, we do it all the time.

Just don’t forget to commit. You can commit in the same node. The node allows you to execute multiple sql statements as long as you have a separator:

6 Likes

Hi,

Thank you for the hint regarding the DB SQL Executor especially the commit and multiple sql statement execution.

Thanks,

Claude.

2 Likes

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