- 论坛徽章:
- 3
|
原帖由 jscmc2004 于 2008-12-29 17:10 发表 ![]()
7楼的指点一下,怎么做呢?
保存为一个文件?然后再执行这个文件嘛?
可以啊,或者写到一个文本里复制出来执行。命令行不好编辑。
- #!/usr/bin/ksh
- awk '{a=$1;q="\047";s=substr($1,1,16);p=substr($1,1,11);if(a ~ /^89/){print "declare resulte varchar(20);\n begin\n select count(*) into resulte from im.im_inv_imsi_use where inv_id between \"q $1 q\" and \"q s $2 q\";\n if resulte = 0 then dbms_output.put_line(\"q $1\" and \"s $2 \" ok\"q\");\n else dbms_output.put_line(\"q $1\" between \"s $2 \" warning have problem!!\"q\");\n end if;\n end;\n/"};if(a ~ /^46/){print "declare resulte varchar(20);\n begin\n select count(*) into resulte from im.im_inv_imsi_use where iccid between \"q $1 q\" and \"q p $2 q\";\n if resulte = 0 then dbms_out.put_line( \"q $1 \"and \"p $2 \" ok \"q\");\n else dbms_output.put_line(\"q $1 between \"p $2 \" have problem!!\"q\");\n end if;\n end;\n/"}}' IMSI.txt>>jh.sql
复制代码 |
|