0

I'm trying to compare the prices of some products stored on my database, while the comparison works fine, the update statement doesn't seem to update the desired field.

for currentRow,newRow in zip(currentInfo,newInfo):

    if currentRow[1]!=newRow[1]:
        print(currentRow[0],newRow[0])
        print("The price of %s has changed from %s to %s" %    (currentRow[0], currentRow[1], newRow[1]))
        db.execute("update table set Prices=? where Product=?",(newRow[1],currentRow[0]))
        conn.commit
2
  • 2
    commit is a method conn.commit() Commented Feb 8, 2017 at 17:33
  • @lmiguelvargasf I'm really embarrassed...I forgot to add the parenthesis. Thank you for your time Commented Feb 9, 2017 at 17:27

1 Answer 1

2

I think you just missed the ().

conn.commit()

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks - helped me too. The fact it doesn't give any error message is confusing.

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.