Okay, I've got the list of tables that need updates. What looping structure works best? As I'm switching from Oracle and MS SQL Server, the looping part seems foreign.
Personally I would use Bash or Perl to read the input ( list generated according to r937's advice ) and generate the output ( an SQL script containing the [tt]delete[/tt] statements to execute ). I mean, I would use command line/desktop tools, not MySQL itself.
delete from orders where custid = 'todd'
delete from customers where id = 'todd'
delete from suppliers where id = 'todd'
delete from products where supplier_id = 'todd'
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.