Here is a sample command line query:
E:\mysql\bin\mysql -urjohnsonjr -pMyHardPassword -D%db% -h192.168.1.100 -P 3301 -e "delete from mlsv20master.mastertable where mlsnumber not in (select mlnumber from %db%.%mls%_allmlsnumbers) and mlsid=1;" -v -v -v
Is there a way for me to add some kind of count to the query to make sure that %db%.%mls%_allmlsnumbers has more than 1000 rows in it?
I was thinking about adding these types of queries to a stored procedure so I could use more logic, but it would be much better if I could add to the query or do something else right there in the command line query to check the count and not actually do the delete if something happens and the %db%.%mls%_allmlsnumbers is empty
What is happening is another part of the script fails and the allmlsnumbers table ends up being blank so the delete statement wipes out all the data in the mastertable which is bad news.