Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

970
Visualizações
Stored procedure in PyODBC writes: not all arguments converted during string formatting

I have this code:

with connections["mssql_database"].cursor() as cursor:
                sql = "EXEC SaveActivity @id_workplace=?, @personal_number=?, @id_activity=?"
                params = (id_workplace, personal_number, id_activity)
                cursor.execute(sql, params)


TypeError: not all arguments converted during string formatting

When I try

cursor.callproc("SaveActivity", [id_workplace, personal_number, id_activity])

it writes:

AttributeError: 'pyodbc.Cursor' object has no attribute 'callproc'
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

This errors occurs because the parameters you are passing don't match the defined types on the database side in SQL Server.

Are @id_workplace, @personal_number and @id_activity all integers? If so, are the Python variables id_workplace, personal_number, and id_activity all integers? What are the values of the Python variables? If any of them are None, you'll need to make sure that the corresponding database variable allows NULL.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda