Chinaunix

标题: 请哪位仁兄看看,我的循环哪里出了毛病? [打印本页]

作者: qym    时间: 2004-05-18 17:29
标题: 请哪位仁兄看看,我的循环哪里出了毛病?
DIR=${INFORMIXDIR-/usr/informix}
dbaccess - - << !
database xjyc;
unload to /usr/depo/qym/q1.txt select sum(famt) from yh_fymx where
fdate=20040418 and ano=0 ;
unload to /usr/depo/qym/q2.txt select -sum(famt) from xjyc_ls where
fdate=20040418 and ano=0 and flag=7;
!
diff q1.txt q2.txt >; q3
if [ $? -eq 0 ]
   then
   echo  "现金缴费ok"
   dbaccess - - << !
   database xjyc;
  unload to /usr/depo/qym/qym_fymx select ano, sum(famt) from yh_fymx where
  fdate=20040418 and ano>;0 group by ano order by ano;
  unload to /usr/depo/qym/qym_ls select ano,-sum(famt) from xjyc_ls where  
  fdate=20040418 and ano>;0 and flag=7 group by ano order by ano;
  !

  diff qym_fymx qym_ls >; q4
        if [ $? -eq 0 ]
        then
        echo "代缴划拨 ok"
        else
        cat q4
        fi
else
       cat q3
             dbaccess - - << !
            database xjyc;
            unload to /usr/depo/qym/xj_fymx.txt select yh_no,sum(famt) from yh_fymx where
            fdate=20040418 and ano=0 group by qt_num order by qt_num;
            unload to /usr/depo/qym/xj_ls.txt select qt_num ,-sum(famt) from xjyc_ls
            where fdate=20040418 and ano=0 and flag=7 group by qt_num order by qt_num;
            unload to /usr/depo/qym/kh_fymx.txt select sum(famt) from yh_fymx where
        fdate=20040418 and ano>;0 ;
        unload to /usr/depo/qym/kh_ls.txt select -sum(famt) from xjyc_ls where
        fdate=20040418 and ano>;0 and flag=7;
        !
    diff xj_fymx.txt xj_ls.txt >; xjbj
    cat xjbj

diff kh_fymx.txt kh_ls.txt >; khje
         if [ $? -eq 0 ]
        then
        echo " ok"
        else
        dbaccess - - << !
        database xjyc;
        unload to /usr/depo/qym/kh_fymx1.txt select ano, sum(famt) from yh_fymx
        where fdate=20040418 and ano>;0 group by ano order by ano;
        unload to /usr/depo/qym/kh_ls1.txt select ano,-sum(famt) from xjyc_ls
        where fdate=20040418 and ano>;0 and flag=7 group by ano order by ano;
        !
        diff kh_fymx1.txt kh_ls1.txt >; khbj
        cat khbj
        fi
fi
本人操作系统为SCOunix,老提示 syntax error at line 文件尾行数: `end of file' unexpected
作者: csycsy998    时间: 2004-05-18 19:50
提示: 作者被禁止或删除 内容自动屏蔽
作者: mywg    时间: 2004-05-19 09:39
标题: 请哪位仁兄看看,我的循环哪里出了毛病?
你把有关的sql分别写成不同的sql文件
用dbaccess<sql文件的方式
试试看
作者: davisho    时间: 2004-05-19 10:58
标题: 请哪位仁兄看看,我的循环哪里出了毛病?
試把sql指令的檔名及 path 用 "" (quot) 包着




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2