Could you do this just via a shell:
Create shell:
SELECT CONCAT('mysqldump --opt <DB_NAME> ', TABLE_NAME,' > ',TABLE_NAME,'.sql & ') as cmd
INTO OUTFILE '/tmp/mysqldump_queries.sh'
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA IN ('<DB_NAME>')
AND TABLE_TYPE = 'BASE TABLE'
AND TABLE_NAME NOT IN ( <Table lists here> );
Edit shell to add #!/bin/sh at the start:
Chmod +x /tmp/*.sh
Then you can run the dump and it will dump all tables in the background locally to wherever you run it.
But are you trying to do a select into OUTFILE but selecting field names and etc instead of an actually schema dump?
SELECT <fields>
INTO OUTFILE '/tmp/filename'
WHERE fields=something
Just trying to help....
http://anothermysqldba.blogspot.com