On Oct 13, 2008, at 11:13 AM, Jonathan Marshall wrote:

>
> Hi,
>
> I'm not sure whether this is a bug in sqlalchemy or user error. I'm
> having trouble passing a parameter to execute() that is a list of
> values for the in operator.
>
> E.g.:
>  session.execute(sql.text('SELECT * from users where x in :xs'),
> params={'xs' : some_seq})
>
> This works fine when using MySQL so long as some_seq is a list of
> integers. It does not return the correct results if some_seq is a list
> of strings. It always fails with OperationalError when using sqlite.
>
> The in_ operator works correctly however my application needs to
> support text SQL input.
>

this is exactly like az's post.   My own possibly naive understanding  
of IN is that it needs to be rendered with individual parameters, i.e.  
IN (?, ?, ?, ?).   I was never aware of the ability to use IN with a  
single array-holding bind parameter.   I haven't experimented with  
this so I could be completely off.



--~--~---------~--~----~------------~-------~--~----~
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