Select into OUTFILE -- how do you append or delete

I have a query that will run and create the file right, however now I need to make some edits. First I need a version that will append to an existing file.... and another that will delete the file if it exists.  

so say I this was the query I was using what would it look like in the above situations...

SELECT insertstatement INTO OUTFILE 'C:\\MW2MP\\conversion.sql' from sqlinserts;
LVL 11
IsisagateAsked:
Who is Participating?
 
snoyes_jwCommented:
You can't from inside the mysql client.  You could from the command line, using redirection.
mysql [options] -e "SELECT insertstaement FROM sqlinserts" > fileToOverWrite
mysql [options] -e "SELECT insertstaement FROM sqlinserts" >> fileToAppend
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.