I am trying to update a column in a table in the db from a df, but it seems the df is not read properly.
any suggestions ?
I can't see any function dealing with it in the docs
this is my function
def update_table_from_pandas(df, table_name, table_id, col_to_update):
stmt =f""" UPDATE {table_name} AS a
SET a.{col_to_update} = {df.dma_id}
FROM {table_name}, {df}
WHERE a.{table_id} = {df.CITY_ID} ;"""
try:
C.execute(stmt)
print('table updated')
except pyexasol.ExaQueryError as e:
print(e)
I am trying to update a column in a table in the db from a df, but it seems the df is not read properly. any suggestions ? I can't see any function dealing with it in the docs
this is my function
thanks