On Sep 30, 2008, at 6:45 PM, mg wrote:

>
> I am following the documentation for literal sql and I am getting the
> following problem:
> result = session.execute("select * from forwards_history where  
> id=:id",
> {'id':328})
>
> results in this error:
> ProgrammingError: (ProgrammingError) syntax error at or near ":"
> LINE 1: ...forwards_history where id=:id
>                                                       ^
> 'select * from forwards_history where id=:id' {'id': 328}
>
>
> any hints?

the ":id" parameter format is understood by the text() construct,  
which is created by session.execute() automatically in 0.5 (its also  
understood by DBAPIs which use "named" bind param format, which to my  
knowledge includes only Oracle).  If you're on 0.4, you'd have to say  
session.execute(text("select * from table where id=:id")), or use the  
paramstyle of the underlying database.





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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