Check sibling questions

Which method of cursor class is used to get the number of rows affected after any of the insert/ update/delete database operation executed from Python?

(A) cursor.rowcount

(B) cursor.getaffectedcount

(C) cursor.rowscount

(D) cursor.rcount

 

Answer:

 

Checking the options

  • (A) cursor.rowcount - It returns the number of rows affected by DML statements.  
  • (B) cursor.getaffectedcount  - It is not a method of cursor class.
  • (C) cursor.rowscount - It is not a method of cursor class.
  • (D) cursor.rcount - It is not a method of cursor class.

 

From the options given above, the function cursor.rowcount is used to get the  number of rows affected after any of the insert/update/delete database operations executed from Python.

So, the correct answer is (A)

Are ads bothering you?

Davneet Singh's photo - Teacher, Engineer, Marketer

Made by

Davneet Singh

Davneet Singh is a graduate from Indian Institute of Technology, Kanpur. He has been teaching from the past 12 years. He provides courses for Maths and Science at Teachoo.