From f48154a6ab93717cafd7acaa07f7680719b01158 Mon Sep 17 00:00:00 2001 From: "Adam J. Henry" Date: Fri, 28 Feb 2014 00:12:03 -0600 Subject: [PATCH] Went back to using mdb-export with "-I mysql" because the default CSV style did not contain appropriate NULL values. This caused mysqlimport to report warnings and use integer value 0 instead. To increase performance, wrap the inserts using BEGIN..COMMIT commands. Enclosed the "Lut+Zea" column in backticks in the sr22.sql file to avoid parsing errors. --- createdb.sh | 6 ++---- sr22.sql | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/createdb.sh b/createdb.sh index 498e1af..5a77674 100755 --- a/createdb.sh +++ b/createdb.sh @@ -29,10 +29,8 @@ $MYSQLCONN $table.sql - mysqlimport -L -u $MYSQLUSER --password=$MYSQLPASS --fields-terminated-by="," --fields-enclosed-by="\"" $MYSQLDB $table.sql - rm $table.sql + echo adding $table + mdb-export -I mysql $SR22 $table | sed '1i BEGIN;' | sed '$ a COMMIT;' | $MYSQLCONN done echo done diff --git a/sr22.sql b/sr22.sql index fe3d39f..56ce295 100644 --- a/sr22.sql +++ b/sr22.sql @@ -141,7 +141,7 @@ CREATE TABLE ABBREV Beta_Carot DOUBLE, Beta_Crypt DOUBLE, Lycopene DOUBLE, - Lut_Zea DOUBLE, -- this was Lut+Zea + `Lut+Zea` DOUBLE, -- this was Lut+Zea Vit_E DOUBLE, Vit_D_mcg DOUBLE, ViVit_D_IU DOUBLE,