If SQLAlchemy version is 2.0.x and later, there are changes when using execute() method on objects returned by create_context(), get_context() and get_connection() APIs of teradataml:
- Changes in execute() method of Engine object returned by create_context() and get_context() APIs of teradataml:
execute() method of Engine object, returned by create_context() and get_context() APIs of teradataml, is not supported.
- Changes in execute() method of Connection objects returned by get_connection() API of teradataml:
execute() method of Connection object, returned by get_connection() API of teradataml, only accepts executable SQL statements and doesn't support string SQL statements.
Teradata recommends using execute_sql() function provided by teradataml version 17.20.00.04 and later.
teradataml 17.20.00.03 and earlier | teradataml 17.20.00.04 and later |
---|---|
create_context(<parameters>).execute(<sql_query>) | create_context(<parameters>) Required only once.
execute_sql(<sql_query>) |
get_context().execute(<sql_query>) | execute_sql(<sql_query>) Assumption is that connection is already established with Vantage database.
|
get_connection().execute(<sql_query>) | execute_sql(<sql_query>) Assumption is that connection is already established with Vantage database.
|