in reply to Use command line argument in script

to your second question: the DELETE deletes all records matching the WHERE clause, and does so in one go

This usually has better performance than doing it one record at a time. If you want to delete a date range (or all records with a date earlier than x), then the most effective way would be to modify your WHERE clause accordingly - of course, after having tested it extensively :)