1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

"TypeError: not all arguments converted during string formatting" when pymysql cursor executing

Discussão em 'Outras Linguagens' iniciado por Stack, Junho 17, 2021.

  1. Stack

    Stack Membro Participativo

    This is the first time for me to use pymysql cursor execute. I have two executes;

    The first one is:

    sql = 'create table if not exists currency(t integer primary key, prediction real default null, realVal real default null)'
    cursor.execute(sql)


    This works perfectly.

    The second one is:

    data = [(1, 12.5), (2, 10.2)]
    sql = 'insert into currency(t, prediction) values(%s, %s) on duplicate key update values prediction=values(prediction)'
    cursor.execute(sql, data)


    The issue arises here. "TypeError: not all arguments converted during string formatting"

    I have no idea why this happens. Anybody help me. Thanks.

    Continue reading...

Compartilhe esta Página