Call a stored procedure for every select result I have an stored procedure to delete from a long series of tables. It uses one main ID as parameter. I have to delete a bunch of rows based on a view that show that lot of tables. I want to apply the deleting procedure to every filtered result from that view. Some thing like:

SELECT id FROM view WHERE another_id=100;


And then apply the stored procedure to those results like:

CALL deleteProcedure(id);
Create another Stored Procedure.  In it, DECLARE a CURSOR for SELECT id FROM view WHERE another_id=100;.  Create a loop; in the loop FETCH one id, then CALL deleteProcedure(id);.  (See the manual and online examples for the details.)