Is there a way to do something like the following ? which doesn\'t work but shows what I want to do
SET @OutputPath = \'/Users/jo/Documents\'
SET @fullOutput
I have a low carma so I'm posting an answer that should go as a comment to Sami's post - you need to enclose the file name by quotes (note added ' before and after @fullOutputPath):
set @q1 := concat("SELECT * INTO OUTFILE '",@fullOutputPath,
"' FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '\"'
FROM database.tableName");