Hello,
I need help clearing a syntax error on a my PREPARE stmt line. Here is my full scrip:
SET @TS = DATE_FORMAT(NOW(),'%Y_%M_%D');
SET @FOLDER = 'c:/logs/test/sta07_';
SET @EXT = '.csv';
SELECT @myCommand =CONCAT("SELECT * FROM test.station07 INTO OUTFILE'",@FOLDER,@TS,@EXT,"' FIELDS ENCLOSED BY '\"' TERMINATED BY '\n' ESCAPED BY '\\'");
PREPARE stm2 FROM @myCommand;
EXECUTE stm2;
I'm getting a syntax error on PREPARE stmt2 FROM @myCommand; near '''. I'm not sure what it means and I have wrong on this syntaxt. The previous lines don't have any errors when I run the scrip. I'm only having errors on the PREPARE stmt2 FROM @myCommand line.
Can anyone help me clear this up?
Thanks!
Jose
I need help clearing a syntax error on a my PREPARE stmt line. Here is my full scrip:
SET @TS = DATE_FORMAT(NOW(),'%Y_%M_%D');
SET @FOLDER = 'c:/logs/test/sta07_';
SET @EXT = '.csv';
SELECT @myCommand =CONCAT("SELECT * FROM test.station07 INTO OUTFILE'",@FOLDER,@TS,@EXT,"' FIELDS ENCLOSED BY '\"' TERMINATED BY '\n' ESCAPED BY '\\'");
PREPARE stm2 FROM @myCommand;
EXECUTE stm2;
I'm getting a syntax error on PREPARE stmt2 FROM @myCommand; near '''. I'm not sure what it means and I have wrong on this syntaxt. The previous lines don't have any errors when I run the scrip. I'm only having errors on the PREPARE stmt2 FROM @myCommand line.
Can anyone help me clear this up?
Thanks!
Jose