#!/bin/csh

echo 'Deleting entries for ISA ...'
\rm ISA.*.tbl Output.ISA.* Error.ISA.*
sqlplus user/passwd@db @ISA.sql

echo 'Splitting ISA in multiple time spans ...'
../../bin/Split_Station ISA

foreach i (ISA.*.tbl)
echo 'Populating ', $i
../../bin/Populate_Station $i > Output.$i:r
mv Error.log Error.$i:r
end

