Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE T (id int, v blob);
- INSERT INTO T (id,v) VALUES(1, COLUMN_CREATE('color', 'blue', 'size', 'XL'));
- import mysql.connector
- cnx = mysql.connector.connect (host=.., user=‘.., password=.., port=.., database=..)
- cursor = cnx.cursor()
- SQL='INSERT INTO T (id,v ) VALUES(%s,COLUMN_CREATE(%s))’
- data=[(10,'"X",2'),(20,'"Y",1')] # <---- I think problem is here
- cursor.executemany(SQL,data)
- cursor.close()
- cnx.commit()
- cnx.close()
Add Comment
Please, Sign In to add comment