Error not all arguments converted when inserting data into mysql in batch using python

I can insert data into the mysql database with this command

insert into moderation_task(id, media_id, user_id, media_url_or_path, media_title, media_source,
          created, updated, status, is_del) values(105, 75, 1,
          "/audit_source/origin_video/2360deca955311e8bbd966d3bcd97028.mp4", "006.mp4", "abc", "2018-08-01 06:21:37", "2018-08-01 06:21:37", 0,
         0)

but cannot insert data using python

this is my python code

users_values = []
            for i in range(105, 195, 1):
                users_values.append((i, 75, 1, "/audit_source/origin_video/2360deca955311e8bbd966d3bcd97028.mp4", "006.mp4", "abc", "2018-08-01 06:21:37", "2018-08-01 06:21:37", 0, 0))
            print(users_values)

            cs1.executemany("insert into moderation_task(id, media_id, user_id, media_url_or_path, media_title, media_source, created, updated, status, is_del) value(%s, %s, %s, %s, %s, %s, %s, %s, %s)",
                            users_values)

it"s the same mistake every time

Apr.02,2021

s seems to be inconsistent with the number of parameters passed before. Your% s has 9, and the values in the users_values you want to pass in do not seem to be 9. These two must be consistent

cs1.executemany('insert into moderation_task(id, media_id, user_id, media_url_or_path, media_title, media_source, created, updated, status, is_del) value(%s, %s, %s, %s, %s, %s, %s, %s, %s)',users_values)
There are 10

fields and only 9 formatted values

cs1.executemany('insert into moderation_task(id, media_id, user_id, media_url_or_path, media_title, media_source, created, updated, status, is_del) value(%s, %s, %s, %s, %s, %s, %s, %s, %s%s)',users_values)

also check the formatted data and the data type of the database, probably.

Menu