SQL输出作为特殊字符出现

时间:2013-12-04 15:56:50

标签: sql

我正在使用以下脚本来获取输出。但是我在#####这样的字母中得到了2个输出。实际上它应该是整数。其他2天列也不显示时间值 任何人都可以帮我解决这个问题吗?

user="aguser"
pass="aguser"
dbname=`echo $LOGNAME|awk '{print substr($0,length($0) - 3)}'`
sql=" SELECT wrk.WO_ID , srq.CSDL_SEQ_NO, srq.ASDL_CMD, srq.HOST_CLLI As NEP, min(srq.START_DTS) as start_dt, max(srq.COMP_DTS) as comp_dt, ((max(srq.COMP_DTS)-min(srq.
START_DTS)) * 86400) as proc_time FROM SARMPRD1.TBL_ASDL_LOG srq, sarmprd1.tbl_wrk_ord wrk where srq.srq_id = wrk.srq_id and to_char(srq.start_dts,'DD/MM/YYYY HH24')=to
_char((sysdate-1/24), 'DD/MM/YYYY HH24') and wrk.WO_STAT = '104' group by wrk.WO_ID, srq.SRQ_ID, srq.ASDL_UNID, srq.CSDL_SEQ_NO, srq.ASDL_CMD,HOST_CLLI order by proc_ti
me desc"

当前输出:

282685884BG      ########## A_DEL_OPT_AUTH            33VANC     04-DEC-13              04-DEC-13              ##########
282686035BJ      ########## A_DEL_OPT_AUTH            33VANC     04-DEC-13              04-DEC-13              ##########
282686105BG      ########## A_DEL_OPT_AUTH            33VANC     04-DEC-13              04-DEC-13              ##########
282686106BI      ########## A_DEL_OPT_AUTH            33VANC     04-DEC-13              04-DEC-13              ##########

预计会出现:

282685884BG      10 A_DEL_OPT_AUTH            33VANC     12/4/2013 9:03:58 AM            12/4/2013 9:07:27 AM              18
282686035BJ      5  A_DEL_OPT_AUTH            33VANC     12/4/2013 9:03:58 AM            12/4/2013 9:07:27 AM              240
282686105BG      5  A_DEL_OPT_AUTH            33VANC     12/4/2013 9:03:58 AM            12/4/2013 9:07:27 AM              330
282686106BI      5  A_DEL_OPT_AUTH            33VANC     12/4/2013 9:03:58 AM            12/4/2013 9:07:27 AM              4440

0 个答案:

没有答案