theres OUT param support for Oracle - MS-SQL dialect could follow the
same approach, provided pyodbc allows it.
The SQL works in our SQL analyzer with or without the named parameter
and with the semicolon. We tried it the way you mentioned too, using
positional parameters, and got the same error. I apologize for
forgetting to mention that in my first post.
Any other ideas? I'll look into the OUT parameter that Bayer mentions
in his post.
> > The SQL works in our SQL analyzer with or without the named parameter
> > and with the semicolon. We tried it the way you mentioned too, using
> > positional parameters, and got the same error. I apologize for
> > forgetting to mention that in my first post.
I think we're using pymssql from a Linux box. Is there a way to tell
which Python module SQLAlchemy is using? We tried running it with
straight pymssql instead and it works in there:
Crumb. Thanks.
Dunno if this is related, but pyodbc and adodbapi execute each statement in a separate context. This caused a problem with scope_identity, as in the original implementation with pyodbc, scope_identity always returned null.
I thought the original impetus for scope_identity was not multiple execution contexts, but rather things being fouled up for some users where they had nested INSERTs being done via a trigger on the mapped table, and the brain-dead SELECT @@identity_insert wasn't able to pluck out the correct PK. Was there another reason I'm missing?
You're right, that was the original motivation. I tried just changing @@identity for scope_identity(), which worked just fine on pymssql, but not on the other adapters. Did eventually get it working, but it involved pyodbc changes, that I was unable to do. Fortunately someone on the list volunteered, which was most appreciated.