SiF
SiF

Reputation: 11

Unable to update the data in Sql database

When i update the data in table using ID , entire column data is changing with new data.

Database name:finaldb Table name:emptable

I want to update the name in emptable, when i give the name it will update the entire column.

(1, '4', 'YYY', 'Program manager', 'CG') (2, '4', 'YYY', 'Program manager', 'CG')

Upvotes: 0

Views: 23

Answers (1)

typing.cat13
typing.cat13

Reputation: 11

You can use row id:

cursor.execute("update emptable set name='YYY' where id=1")

Upvotes: 1

Related Questions