Hi;
I have this:

    for order in order_details:
      store = order[0]
      prodid = order[1]
      pkg = order[2]
      quantity = order[3]
      if 'PatientID' in order_fields:
        patientID = order[4]
        try:
          option_values = order[5:]
        except TypeError:
          option_values = []
        sql = 'insert into orders%s values (Null, %s)' % (store, ",
".join("%s" * (4 + len(option_values))))
        cursor.execute(sql, tuple([pkg, prodid, tmpTable, quantity] +
option_values))
      else:
        patientID =  ''
        try:
          option_values = order[4:]
        except TypeError:
          option_values = []
        sql = 'insert into orders%s values (Null, %s)' % (store, ",
".join("%s" * (4 + len(option_values))))
#        cursor.execute(sql, tuple([pkg, prodid, tmpTable, quantity,
order[4], order[5]]))
        cursor.execute(sql, tuple([pkg, prodid, tmpTable, quantity] +
option_values))

It throws this error:

*TypeError*: can only concatenate list (not "tuple") to list
      args = ('can only concatenate list (not "tuple") to list',)

Where's the list? They're both tuples in that last line of code.
TIA,
beno
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to