Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list1 = [(1100, 'abc', '{"1209": "Y", "1210": "Y"}'), (1100, 'abc', None)]
- def insert_sample_data(col_val):
- cur = self.con.cursor()
- sql = """insert into sampletable values {}""".format(col_val)
- cur.execute(sql)
- self.con.commit()
- cur.close()
- values1 = ', '.join(map(str, list1)) #bulk insert
- insert_sample_data(values1)
Add Comment
Please, Sign In to add comment