root/trunk/bin/publish_analytical_db @ 13571
1 | 6471 | aaronmk | #!/bin/sh
|
---|---|---|---|
2 | # Publishes analytical DB to nimoy
|
||
3 | |||
4 | 6651 | aaronmk | if ! test -n "$table" -a "$#" -eq 1; then |
5 | 6650 | aaronmk | echo "Usage: env table=... $0 export.csv"|fold -s >&2 |
6 | exit 2
|
||
7 | fi
|
||
8 | |||
9 | 6732 | aaronmk | "time" mysql --password --database=bien3_adb <<EOF |
10 | 6474 | aaronmk | LOAD DATA LOCAL INFILE '$1' |
11 | 6650 | aaronmk | INTO TABLE $table |
12 | 6474 | aaronmk | FIELDS TERMINATED BY ','
|
13 | OPTIONALLY ENCLOSED BY '"'
|
||
14 | IGNORE 1 LINES
|
||
15 | ;
|
||
16 | EOF
|