Project

General

Profile

« Previous | Next » 

Revision 6650

publish_analytical_db: Require caller to specify the name of the table to load data into. This allows appending a revision to analytical_aggregate, or publishing a table other than analytical_aggregate.

View differences:

publish_analytical_db
1 1
#!/bin/sh
2 2
# Publishes analytical DB to nimoy
3
# Usage: self analytical_aggregate.csv
4 3

  
4
if ! test -n "$test" -a "$#" -eq 1; then
5
    echo "Usage: env table=... $0 export.csv"|fold -s >&2
6
    exit 2
7
fi
8

  
5 9
mysql --password --database=bien3_adb <<EOF
6 10
LOAD DATA LOCAL INFILE '$1'
7
INTO TABLE analytical_aggregate
11
INTO TABLE $table
8 12
FIELDS TERMINATED BY ','
9 13
OPTIONALLY ENCLOSED BY '"'
10 14
ESCAPED BY '"'

Also available in: Unified diff