List:General Discussion« Previous MessageNext Message »
From:Johan De Meersman Date:March 1 2012 1:53pm
Subject:Re: How do I use a dynamic filename for an into outfile statement
View as plain text  
By using your shell's variable substitution, I'm afraid.

  export outfile='/path/to/file'
  mysql -e "select blah into outfile '$outfile'"

You'll have to build a shell script or something that generates your filename, and then do
an interactive call.

Maybe you could write a stored procedure that generates a query string and then executes
it, too - I've little to no experience with SPs in MySQL.


-- 
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel
Thread
How do I use a dynamic filename for an into outfile statementEd Patterson1 Mar
  • Re: How do I use a dynamic filename for an into outfilestatementhsv1 Mar
  • Re: How do I use a dynamic filename for an into outfile statementJohan De Meersman1 Mar
  • Re: How do I use a dynamic filename for an into outfile statementPaul DuBois1 Mar