Running MySql version 5.6.17 on a ML350 G5 server. The operating system is Small Business Server 2008
Please understand I am learning Mysql . I am not an expert.
Each day a text file must be imported into table Pivot.tblPivotTxt.
The command to do this is:
LOAD DATA INFILE 'd:\Investing – Programming\MySql\TxtData\PivotValues.csv'
INTO TABLE Pivot.tblPivotTxt
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
IGNORE 1 ROWS
I must type this each and every day. I have searched for a way to write this as some script but it seems this instruction cannot be put into a sql script file. I guess the CREATE PROCEDURE command does not allow LOAD DATA INFILE in a sql script. [This is my guess]
I have a batch file which will start the Mysql command line interface (I guess that's what it is called).
I have to type in the password then I see the mysql >
Then I have to type in the commands shown above.
There must be a better way.
Q1.) How can I turn this into a batch file of some sort so I can schedule it to run at a certain time?
Q2.) What code would you write to start the Mysql command line interface? I am assuming it must be started first before any script is executed. My assumption could be totally wrong.
Q2.) Where would I look for a log file to tell me if the procedure failed or succeeded?
Remember I am not an expert. Please give me a detailed answers. If you have a better way to do this then please explain how.
Useful links are always appreciated.