2

I have a stored procedure

exec dbo.update_candidate "ur", 0

where "ur",0 -is paramtrs

But if it is called in the program, it does not work:

params = list()
name1 = "ur"
voises1 = "1"
params1=(name1,voises1)
cursor.execute("{CALL update_candidate (?,?)}",params1)
2
  • 2
    Please define it does not work? Do you get an error? It just doesn't execute? Do you have an open connection to the SQL Server? Commented Jul 26, 2017 at 12:29
  • Can you give more details of the error and the code? are you using pyodbc? Commented Jul 28, 2017 at 9:19

1 Answer 1

1

In Pyton

   params2=(name1,'5')
   cursor.execute("exec dbo.update_candidate %s,%s" % params2)
   cursor.commit()

In SQLServer:

exec dbo.update_candidate "Hadjr", 2
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.