lists in cx_Oracle

infidel saint.infidel at gmail.com
Mon May 2 13:59:06 EDT 2005


I think perhaps you are asking for something that the OCI doesn't
provide.  At least I'd be rather surprised if it did.  I know that the
SQL syntax doesn't provide for such a mechanism.

And really, it all boils down to the list comprehension:

in_clause = ', '.join([':id%d' % x for x in xrange(len(ids))])

... elegance is certainly subjective, and the above statement isn't the
cleanest ever, but it solves your main problem while avoiding the other
problem you mentiong (sql injection).  Seems "elegant enough" to me.




More information about the Python-list mailing list