#!/bin/bash
[ "$3" == "" ] && exec echo "Usage: $0 <table_name_db> <table_name_cht> <cgi_cmd>"

TABLE_NAME_DB=$1
TABLE_NAME_CHT=$2
CGI_CMD=$3

echo "INSERT INTO web_table_mapping VALUES ('${TABLE_NAME_DB}', '${TABLE_NAME_CHT}', '${CGI_CMD}');"
psql -U postgres Tools -c "INSERT INTO web_table_mapping VALUES ('${TABLE_NAME_DB}', '${TABLE_NAME_CHT}', '${CGI_CMD}');"
