[Sqlalchemy-tickets] Issue #3424: mssql aliasing of schema-tables in update (zzzeek/sqlalchemy)
Brought to you by:
zzzeek
|
From: Andrey Z. <iss...@bi...> - 2015-05-16 23:09:43
|
New issue 3424: mssql aliasing of schema-tables in update https://bitbucket.org/zzzeek/sqlalchemy/issue/3424/mssql-aliasing-of-schema-tables-in-update Andrey Zholos: When updating a table with a specified schema name, some parts of the generated statement refer to the table with an alias and some parts don't. A subquery uses an alias that was not introduced (it could be introduced in an mssql "from" clause): ``` #!sql UPDATE [schema].sometable SET val= (SELECT [#other].newval FROM [#other] WHERE sometable_1.sym = [#other].sym) ``` An alias is introduced but the "where" clause doesn't use it: ``` #!sql UPDATE [schema].sometable SET val=[#other].newval FROM [schema].sometable AS sometable_1, [#other] WHERE [schema].sometable.sym = [#other].sym ``` Both of these statements fail. Complete program attached. |