Forum Moderators: open
Say I have this query:
LOAD DATA LOCAL INFILE 'C:\\\Program Files\\\Metrix Statistical Server\\\dcomb_drop.CSV'
INTO TABLE metrix.drops
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
(BSCID,Cellid,Seiz,Drps,dropflag,Total,Dlta,RF,Oth,Traff,trafflag,IHFL,ihfflag,TCD,TCA,SDD,SDA,TAVL, tchaflag,Drate,date)
SET date = CURDATE()
How can I make this a bat file?
I then want to put it in a scheduler and make it run everyday.
Please help me with this,
not sure how to do a .bat file - probably just put that command in a file and name it something.bat
for the scheduler, you do Control Panel, Scheduled Tasks, Add Scheduled Task and follow the Wizard.
mysql --user= --password= --execute=LOAD DATA LOCAL INFILE 'C:\\\Program Files\\\Metrix Statistical Server\\\dcomb_drop.CSV'
INTO TABLE metrix.drops
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
(BSCID,Cellid,Seiz,Drps,dropflag,Total,Dlta,RF,Oth,Traff,trafflag,IHFL,ihfflag,TCD,TCA,SDD,SDA,TAVL,tchaflag,Drate,date)
SET date = CURDATE() metrix
you could also put your query in a text file and feed that to the command:
mysql --user=user_name --password=your_password db_name <textfile.sql
[dev.mysql.com...]
Personally, since you are going to make this a scheduled job I would recommend using the full path in your command when you add the command to the job schedule.