I have script that populates tables with data. I need to record in another table STATS, when it started loading and when it completed the load.
So in the first script I stored timestamp into variable:
**script1.sh**
dtMODEL=$(date +"%d-%b-%y %H.%M.%S.%N %p")
./load_table.sh source1
./load_table.sh source2
./record_table_load_stats.sh MODEL $dtMODEL
**record_table_load_stats.sh**
#! /bin/bash
#
. /etc/profile.d/oracle.sh
MODEL=$1
START_DATE=$2
echo $MODEL
echo $START_DATE
sqlplus -s username/password<< !
/* this is where I wanna use START_DATE variable and populate table*/
when I do:
echo $dtMODEL
15-Oct-13 13.56.46.677879674 PM
but when I pass it to record_table_load_stats.sh, it echoes
15-Oct-13
why?