List:General Discussion« Previous MessageNext Message »
From:Ed Patterson Date:February 29 2012 4:43pm
Subject:How do I use a dynamic filename for an into outfile statement
View as plain text  
Be kind, I am by no means any type of DB expert.

I would like to eventually move this to a stored procedure but for now I 
am using the \. to fire it off.

Here is what I have so far (generating a list of machines missing software)

select last_logon.host_name_short
from last_logon
left join mcafee on last_logon.host_name_short = last_logon.host_name_short
where mcafee.host_name_short is null
and last_logon.host_name_short like 'w%'
-- the above works
into outfile (select 
concat('Missing-',date_format(now(),'%Y%m%d%H%i'),'txt');
-- this line breaks it

The select concat() works from the command line
I can manually add the file name but would like to automate the process
Lastly, if it makes a difference, I don't use any graphical tools for DB 
stuff. Inevitably someone says 'click here' :-)

Thanks for any help
Ed
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