It is quite simple to write an MySQL query result directly to a CSV file:
SELECT * FROM MyTable INTO OUTFILE '/my/file.csv'
How can I write the table output of a procedure directly to a file, i.e. something alike this?
CALL MyProc('MyPar1') INTO OUTFILE '/my/file.csv'
The procedure should not be changed.