Hey all,

I have the following query:

cursor.execute( "select * from MyTable where Foo=%s or Bar in %s", 
[some_id, some_array] )

This seems to work fine if len(some_array) > 1 but it blows up if there are 
zero or one items in the array (invalid SQL syntax).

Is there a better way to do this?  The Python DB-API docs seems to be very 
light.  Could not find anything relevant.

Thanks

Thanos


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to