Teradata MERGE yielding no results when executed through SQLAlchemy

前端 未结 1 1341
梦毁少年i
梦毁少年i 2020-12-04 01:26

I\'m attempting to use python with sqlalchemy to download some data, create a temporary staging table on a Teradata Server, then MERGEing that table into another table which

1条回答
  •  再見小時候
    2020-12-04 01:44

    Since you're using the engine directly, without using a transaction, you're probably (barring unseen configuration on your part) relying on SQLAlchemy's version of autocommit, which works by detecting data changing operations such as INSERTs etc. Possibly MERGE is not one of the detected operations. Try

    sql = sqlalchemy.text(merge).execution_options(autocommit=True)
    td_engine.execute(sql)
    

    0 讨论(0)
提交回复
热议问题