MySQL Forums
Forum List  »  InnoDB

dynamic outfile name
Posted by: David Harris
Date: August 12, 2007 06:29PM

I am attempting to create text files using a batch file. This script below works to a point. Because the outfile can not be overwritten, I would like to name the text file with a unique name based upon the date and time. The @marcFile variable gets assigned but I can not pass it to outfile query.

------------------------------------
SELECT @sync:=concat(CURDATE(),CURTIME());

SELECT @marcFile:=CONCAT('c:/scripts/marcUpdate', @sync,'.txt');

SELECT * INTO OUTFILE @marcFile /* This works -> 'c:/scripts/marcUpdate.txt'*/
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM marcupdate;

------------------------------------
Any suggestions?

Best regards.

Options: ReplyQuote


Subject
Views
Written By
Posted
dynamic outfile name
10510
August 12, 2007 06:29PM
3385
August 13, 2007 05:24AM
3426
August 13, 2007 10:05PM
3251
August 14, 2007 02:16AM
3786
August 19, 2007 11:31AM
3541
August 19, 2007 06:46PM
3439
February 13, 2008 02:49PM
2767
February 14, 2008 04:45PM
2728
February 15, 2008 02:26PM
2589
February 20, 2008 04:12AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.