Skip to content
Advertisement

INSERT INTO SELECT based on a dataframe

I have a dataframe df and I want to to execute a query to insert into a table all the values from the dataframe. Basically I am trying to load as the following query:

JavaScript

For that I have the following code:

JavaScript

However, I am getting the following error:

JavaScript

Does anyone know what I am doing wrong?

Advertisement

Answer

See below my favourite solution, with UPSERT statement included.

JavaScript
Advertisement