>
> The actual string defining the query is lost with sql alchemy. I can
> get similar results with pyodbc (without using parameters) by passing
> a unicode version of the query string. All queries passed by sql
> alchemy show up as empty strings according to the profiler. I assume
> that there is some character formatting mismatch somewhere that causes
> this but I am at a loss to say where: sql alchemy, pyodbc, odbc driver
> (Actual Technologies), the db server itself.
any kind of encoding issue would raise an error immediately. You need
to do some more experimentation, and or produce a more complete test
case illustrating the behavior you're seeing for us to have any
further insight. Experiments include: what happens if you execute a
plain string with the engine , i.e. engine.execute("insert into table
values (:foo)", foo='bar') ? try it with unicode bind params ? what
happens if you execute against a sqlite database instead of MSSQL?
what happens if you purposefully use a nonexistint column name with
the insert().execute() parameters ? are you squashing errors within a
try/except ? etc.
>
> Using a nonexistent column name curiously produces no errors and
> runs. The output (when echo=True for the engine) and the trace are a
> bit different though. It produces a query that specifies no columns
> or parameters. The profiler just shows a series of commits / empty
> strings / roll backs being processed.
ok, that one aspect here might be SQLA's fault, in that it's ignoring
the nonexistent column name instead of raising an error.
I think at this point you should try some pdb stepping just to isolate
exactly where things are getting lost. I'm pretty sure you either
have something weird going on with your DBAPI driver or you're somehow
using the insert() construct incorrectly (though your sample code
looked fine). this is not an issue we've seen before.