You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For my project, I'm currently trying to use pytsql for use cases beyond replacing DB or table names. In particular, I want to make use of conditionals.
However, I run into some issues there:
Executing certain functions within conditionals throws me (an) unexpected error(s)
E.g., if you want to parameterize whether a certain table or a view is created. For views, I use the following approach:
IF 1 = 1
BEGIN
SET NONEXEC ON
END
GO
CREATE VIEW v AS ...
SET NONEXEC OFF
... however, pytsql indirectly throws me an unexpected error via sqlalchemy: sqlalchemy.exec.ResourceClosedError: This result object does not return rows. It has been closed automatically. (If it's helpful I can also post the full error, but that requires some anonymization first)
Declaring variables within the conditional seems current not possible.
while there is an obvious workaround by declaring every variable at the top of the file, pytsqls behavior is unexpected
For my project, I'm currently trying to use
pytsql
for use cases beyond replacing DB or table names. In particular, I want to make use of conditionals.However, I run into some issues there:
... however,
pytsql
indirectly throws me an unexpected error viasqlalchemy
:sqlalchemy.exec.ResourceClosedError: This result object does not return rows. It has been closed automatically
. (If it's helpful I can also post the full error, but that requires some anonymization first)pytsql
s behavior is unexpectedSET
statements for local variables are unreliable #19The text was updated successfully, but these errors were encountered: