1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
nomFic="'$2'"
nomFic2=$2
rootPath=$1
peri="INITTT"
nomTable="GGGGGG"
codRet="OK"
codRet2="OK"
(
sqlplus -s -L $3/$4<<EOF
set head off feedb off lin 30000 trims on
var cr varchar2(2);
var nt varchar2(10);
var per varchar2(6);
exec :cr := PACK_TEST1($nomFic, :nt, :per);
SELECT :cr, :nt, :per from dual;
EOF
)|grep . |read codRet nomTable peri
nomTable="'$nomTable'"
peri="'$peri'"
echo $codRet "=" $nomTable "=" $peri
if [$codRet="OK"] then
(
sqlplus -s -L $3/$4<<FinFic
set head off feedb off lin 30000 trims on
var cr varchar2(2);
exec :cr := PACK.TEST2($nomTable, $peri);
SELECT :cr from dual;
FinFic
)|grep . |read codRet2
if [$codRet2="OK"] then
ln $rootPath/FERMAT_RECEPT/$2 $rootPath/FERMAT_RECEPT/$2.dat
sqlldr userid=$3/$4 control=$rootPath/CTL/$nomTable.ctl log=$rootPath/LOGLOADER/$nomFic2.log bad=$rootPath/LOGLOADER/$nomFic2.bad data=$rootPath/FERMAT_RECEPT/$nomFic2.dat
rm $rootPath/FERMAT_RECEPT/$2.dat
Check.sh $3 $4 $nomFic $nomTable $peri
fi
fi |
Partager