Esta es la extructura de mi script.
Lo hice asi porque no puedo meter la clause LOAD DATA INFILE dentro un procedimiento, y por questiones de seguridad no quiero usar query dentro de mi programa java...
Código HTML:
use mydb;
SET foreign_key_checks = 0;
truncate table table1;
truncate table table2;
truncate table table3;
SET foreign_key_checks = 1;
load data local infile 'C:/temp/table3.csv'
into table table3 fields terminated by ','
enclosed by '"'
lines terminated by '\r\n';
load data local infile 'C:/temp/table2.csv'
into table table2 fields terminated by ','
enclosed by '"'
lines terminated by '\r\n'
ignore 1 lines;
load data local infile 'C:/temp/table1.csv'
into table table1 fields terminated by ','
enclosed by '"'
lines terminated by '\r\n';