0

I have the following table within my database. I need to write a store procedure that will send all the data to a text file. The following works, however, I would like to format in such way that every row in the database should correspond to a line in the text file. Here is my stored procedure and a picture of my database:

CREATE DEFINER=`root`@`localhost` PROCEDURE `outPutTweets`()
BEGIN

SELECT tweetID, accountName, tweet, DATE_FORMAT(Time,'%H:%i') INTO OUTFILE 'C:/xampp/htdocs/Dropbox/SportsMedia/ScrollbarProject/results.txt'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
  LINES TERMINATED BY '\n'
From tweets ORDER by Time desc;
END

enter image description here

cwallenpoole
  • 79,954
  • 26
  • 128
  • 166
Alexander
  • 599
  • 2
  • 14
  • 25

0 Answers0