0
SELECT *
FROM project
INTO OUTFILE 'C:\desktop\[timestamped filename like 01/05/2014.csv]';

Can anyone help me out?

  • SET @OUTFILE = CONCAT( CONCAT('C:\\Users\\harinath.mn\\Desktop\\New folder\\reports1-', NOW()), '.csv'); select * from project into outfile '@OUTFILE' ; I have used it but once it showed rows effected but again when is execute it shows error code 1086 – user37824 May 1 '14 at 15:06
1

Has said in this post, you can use:

SET @sql_text = 
   CONCAT (
       "SELECT * FROM `project ` into outfile 'C:\desktop\"
       , DATE_FORMAT( NOW(), '%d/%m/%Y')
       , ".csv'"
    );

PREPARE s1 FROM @sql_text;
EXECUTE s1;
DROP PREPARE s1;

Thanks Haim Evgi for the original answer.

Max.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.