Dear Experts,

I'm using SQLAlchemy 0.4. The following hard-coded statement works
fine --

result = model.Session.execute("select * from labels where
labelid=10", {'labelid':10}, mapper=model.Label)

which returns something like --

mydb=# select * from labels where labelid=10 ;
 labelid | label_name  |  locale
---------+-------------+----------
      10 | electronics | en_US
(1 row)

However, the following parameterized version fails --

result = model.Session.execute("select * from labels where
labelid=:labelid", {'labelid':10}, mapper=model.Label)

with the following syntax error exception --

...
File '/home/jerry/lib/python2.5/site-packages/SQLAlchemy-0.4.0-
py2.5.egg/sqlalchemy/engine/base.py', line 869 in _cursor_execute
  raise exceptions.DBAPIError.instance(statement, parameters, e)
ProgrammingError: (ProgrammingError) syntax error at or near ":"
LINE 1: select * from labels as l where l.labelid=:labelid
                                                  ^
 'select * from labels as l where l.labelid=:labelid' {'labelid': 10}

I don't believe I've caught a bug, but what else can it be/have I done
wrong?

Many thanks in advance.

Jerry
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to