Aaron Spike wrote:
> sqlalchemy.exceptions.SQLError: (ProgrammingError) parser: parse error
> at or near ":" at character 148
>  'SELECT "vPersons"."Person_ID", "vPersons"."Person_LastFirstM",
> "vPersons"."Person_LastName" \nFROM "vPersons" \nWHERE "vPersons"."Person_La
> stName" = :"vPersons"_"Person_LastName"'
> {'"vPersons"_"Person_LastName"': 'Spike'}

So it looks like SQLAlchemy assumes all legal SQL identifiers are legal
identifiers to use as named parameters to queries for dbapi. Tracing
this back a little further I've found that the problem is in the
_get_label() method of the ColumnClause class in sql.py. If I insert
something simple like 'self.__label = "".join([x for x in self.__label
if x.isalnum()])' before line 1199 things start to work. If someone with
more knowledge of SQL and SQLAlchemy can suggest a robust way of
handling this I'll write up a proper patch.


Aaron Spike

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to