I see, thanks again for your reply and clarification, I'm quite new to the
environment. It looks like for this kind of usage I should move to pyodbc
directly instead of sqlalchemy. If I do so and find anything else, I'll let
you know. Fortunately, for now, the code serves its purpose.
On
hi there -
if you are sending that whole string to execute() with multiple statements
embedded, this again has nothing to do with SQLAlchemy and you want to deal
with whatever pyodbc and your underlying ODBC driver are doing with the SQL
commands being passed to them.
On Tue, Apr 7, 2020,
PS. errata, change var1/var2 for col1/col2..
-- SQL START
SET ANSI_WARNINGS OFF
SELECT
id_col,
col1,
col2,
-col1 AS col1_neg,
-col2 AS col2_neg
INTO output_table_temp
FROM input_table;
UPDATE output_table_temp SET col1 = NULL WHERE col1 <= 0
UPDATE
Hi Mike, thanks for your reply.
Regarding context, here's a sample sql with 2 cols:
-- SQL START
SET ANSI_WARNINGS OFF
SELECT
id_col,
col1,
col2,
-var1 AS var1_neg,
-var2 AS var2_neg
INTO output_table_temp
FROM input_table;
UPDATE output_table_temp SET
this warning is not related to SQLAlchemy it has to do with the structure of
SQL you are passing to connection.execute(). some background I found via
googling here:
https://stackoverflow.com/questions/11384292/warning-null-value-is-eliminated-by-an-aggregate-or-other-set-operation-in-aqua
I have my own tran() function, as the doc suggests:
engine = sqlalchemy.create_engine(
'mssql+pyodbc://@SHINKEN/supervielle?trusted_connection=yes=ODBC+Driver+13+for+SQL+Server'
, fast_executemany = True)
def tran(sql,engine):
with engine.begin() as conn:
conn.execute(sql)
I execute