Hi Everyone,
Please find below the script, I needed to understand step by step
. Please If someone can help me out i will be very greatful
.
Please Guide me in a way which can help me out in figuring what this script doing on my server.
========================================================
#!/bin/sh
time=`date +%Y%m%d-%H%M%S`
echo $time":: process of modification started..."
while read abcd
do
dbaccess xyzdb << EOF >> db$abcd.log 2>&1
alter table $abcd add ( encrypt char(11) ) ;
create index idx_neuker on $abcd(insys_serial) ;
update statistics high for table $abcd(insys_serial);
create procedure p$abcd()
returning char(40);
DEFINE acc_num char(20);
DEFINE i integer;
DEFINE sum integer;
set debug file to 'pev_rech_yyyymmnn.log';
trace 'begin update';
let i = 0;
let sum=0;
begin work;
foreach up_cur with hold for
select insys_serial into acc_num from $abcd
update $abcd set encrypt=msisdn where insys_serial=acc_num;
let i=i+1;
let sum=sum+1;
if i=10000 then
trace 'record processed '||sum;
commit work;
let i=0;
begin work;
end if
end foreach
commit work;
trace 'procedure ok! total processed records are '||sum;
return "procedure complete!";
end procedure;
execute procedure p$abcd();
drop procedure p$abcd ;
drop index idx_neuker;
EOF
time=`date +%Y%m%d-%H%M%S`
echo $time":: "$abcd" table is modified."
done < ab_done_yyyymm_tablenames.unl
=========================================================