On Thu, Jun 3, 2010 at 12:25 PM, MRAB <pyt...@mrabarnett.plus.com> wrote:
> So our_options is a list containing two values, which you're putting > into a tuple: > > >>> our_options = ["first", "second"] > >>> print len(our_options) > 2 > >>> value_tuple = (our_options,) > >>> print len(value_tuple) > 1 > >>> > > In other words, value_tuple is a tuple which contains one value, a list. > Understood. So I tried this (to include the other values): sql_string = 'insert into tmp%s values (%s, %s, %s, "%s")' % (tmpTable, store, prodid, pkg, our_options_string[:-4]) sql = 'insert into tmp%s values (%%s, %%s, %%s, %%s)' % tmpTable cursor.execute(sql, (store, prodid, pkg, our_options)) Which, of course, gives me the same error, because I'm still putting in the same len for the final value. What do now? TIA, beno
-- http://mail.python.org/mailman/listinfo/python-list