I have an application that needs to interact with a database through use of good old fashioned models as well as generated sql.
Session = sessionmaker(bind=engine)()
cmd = """insert into "STO_BANK_CONTROL" ("isn","TRANS_REF_NO","weird") values (8078638,'#:0057/13 ','');"""
Session.execute(cmd);
This raises the exception:
StatementError: A value is required for bind parameter u'0057' (original cause: InvalidRequestError: A value is required for bind parameter u'0057') u'insert into "STO_BANK_CONTROL" ("isn","TRANS_REF_NO","weird") values (8078638,\'#%(0057)s/13 \',\'\');' [{}]
but if I copy cmd straight into the psql console it works just fine.
My question is:
Why is sqlalchemy breaking working code and how do I prevent this from happening?