[Mysql] python executemany ์‚ฌ์šฉ์‹œ TypeError: not all arguments converted during string ...
ยท
๐Ÿ›ข๏ธ Database
cursor.executemany(sql, data)๋กœ ๋‹ค์ˆ˜์˜ ๋กœ์šฐ ๋ฐ์ดํ„ฐ๋ฅผ INSERT ํ•  ์ˆ˜ ์žˆ๋‹ค. sql : INSERT ์ฟผ๋ฆฌ ๋ฌธ์„ ๋„ฃ์œผ๋ฉด ๋œ๋‹ค. sql = """INSERT INTO TBL_NAME (COL1_NAME, COL2_NAME, COL3_NAME) VALUES(%s,%s,%s)""" data : sql ์ž…๋ ฅ ํŒŒ๋ผ๋ฏธํ„ฐ๋“ค์„ tuple๋กœ ๋งŒ๋“ค๊ณ  list๋กœ ๊ฐ์‹ธ์ฃผ๋ฉด ๋œ๋‹ค. data = [(parm1,parm2,parm3),(parm1,parm2,parm3),(parm1,parm2,parm3)....] [ERROR] TypeError: not all arguments converted during string sql๋ฌธ์—์„œ ON DUPLICATE KEY UPDATE ์‚ฌ์šฉ์‹œ ์ฃผ์˜ [์ž˜๋ชป๋œ ๋ฐฉ์‹] s..
๋‹คํ–ˆ๋‹ค
'mysql' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก