Guest User

Untitled

a guest
Sep 18th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. list1 = [(1100, 'abc', '{"1209": "Y", "1210": "Y"}'), (1100, 'abc', None)]
  2.  
  3. def insert_sample_data(col_val):
  4. cur = self.con.cursor()
  5. sql = """insert into sampletable values {}""".format(col_val)
  6. cur.execute(sql)
  7. self.con.commit()
  8. cur.close()
  9.  
  10. values1 = ', '.join(map(str, list1)) #bulk insert
  11. insert_sample_data(values1)
Add Comment
Please, Sign In to add comment