I've been thinking, might it be possible to dynamically change MySQL select-statement with variables.
ex.
SET @infile=1;
SELECT *
IF( @infile )
INTO OUTFILE 'myfile.csv'
ENDIF
FROM my_table;
Or do I just have to go with my current solution
SELECT *
-- INTO OUTFILE 'myfile.csv'
FROM my_table;
So always when I want to load data into file, I'll just uncomment "INTO"-line. My statements are way bigger than this example, so solution would make life much easier, if possible :)