cd /odfs01/oddev3/proc_xd/Image/A
db2 "connect to databasename user db2app using "
#for file in IDXA*.TXT
#do
# ls $file
# file_name=`echo $file|cut -f 1 -d .`
# echo $file_name
# db2 "drop table SCOTT.IMAGE_"$file_name" "
#db2 " CREATE TABLE SCOTT.IMAGE_"$file_name"(DOCDATE CHAR(8), MobileNo VARCHAR(512), OwnerName char(50),ReceiveTime char(8),Bus_Type char(1),OperNo char(20),TelNo varchar(512),CustName char(50), VolumeNo char(15), CDID char(15), INDEXID integer, DOCID integer, STATUS char(1) ) DATA CAPTURE NONE IN USERSPACE3 "
#db2 "create index scott.IMAGE_"$file_name"_1 on SCOTT.IMAGE_"$file_name"(DOCDATE) " #>/dev/null
#db2 "create index scott.IMAGE_"$file_name"_2 on SCOTT.IMAGE_"$file_name"(INDEXID) " #>/dev/null
#db2 "load client from /odfs01/oddev3/proc_xd/Image/A/"$file_name".TXT of del insert into SCOTT.IMAGE_"$file_name" without prompting"
#db2 " alter table SCOTT.IMAGE_"$file_name" volatile "
#db2 "select count(*) from SCOTT.IMAGE_"$file_name" "
#done
#db2 "disconnect bosstab"
cd /odfs01/oddev3/proc_xd/Image/A
db2 "connect to databasename user db2app using "
for file in DOCA*.TXT
do
# ls $file
file_name=`echo $file|cut -f 1 -d .`
echo $file_name
db2 "drop table SCOTT.IMAGE_"$file_name" "
db2 " CREATE TABLE SCOTT.IMAGE_"$file_name" (DOCDATE CHAR(8), SCANDATE CHAR(8), DOCID integer, PARTID INTEGER, PAGEID INTEGER, IMAGE_FILE CHAR(8), IMAGE_TYPE INTEGER, SIDEFLAG CHAR(1), GUID CHAR(32), STATUS char(1) ) DATA CAPTURE NONE IN USERSPACE3"
db2 " create index scott.IMAGE_"$file_name"_1 on SCOTT.IMAGE_"$file_name"(DOCDATE)"
db2 " create index scott.IMAGE_"$file_name"_2 on SCOTT.IMAGE_"$file_name"(SCANDATE)"
db2 " create index scott.IMAGE_"$file_name"_3 on SCOTT.IMAGE_"$file_name"(PARTID)"
db2 " create index scott.IMAGE_"$file_name"_4 on SCOTT.IMAGE_"$file_name"(PAGEID)"
db2 " create index scott.IMAGE_"$file_name"_5 on SCOTT.IMAGE_"$file_name"(SIDEFLAG)"
db2 "load client from /odfs01/oddev3/proc_xd/Image/A/"$file_name".TXT of del insert into SCOTT.IMAGE_"$file_name" without prompting"
db2 " alter table SCOTT.IMAGE_"$file_name" volatile "
db2 "select count(*) from SCOTT.IMAGE_"$file_name" "
done
db2 "disconnect databasename "
阅读(1312) | 评论(0) | 转发(0) |