MySQL command-line tool: How to find out number of rows affected by a DELETE? -


I am trying to run a script that removes a bunch of rows in the innodb table by executing it into a batch Gives the following in a loop:

  mysql --user = MyUser --password = MyPasswordMidetabase & lt; SQL_FILE  

Where SQL_FILE contains a DELETE FROM ... LIMIT X command.

I have to run this loop unless there are no other matching rows but unlike mysql running in the shell, the above command does not return the number of affected rows. I have tried- v and -t but it does not work

Thanks!

You SELECT ROW_COUNT () at the end of the batch script; .


Comments