There’s a way of getting the rows affected by an update, insert or delete MySQL query in CFScript.
I didn’t realise this until yesterday, and I’ve been doing this for a while now. I really should read more release notes.
I’ll update my http://skeater.co.uk/page.cfm/CFScript-Snippets page to show this, but I thought it was worth posting about anyway
// create query string
strSelectRows = 'DELETE FROM table WHERE col = "potato"';
// create query, assign datasource, assign query string, execute and capture returned result
qrySelectRows= new Query();
// dump results out
Check the demo here to see the tasty results. I’ve also shown the whole prefix component in the demo.