运行出错sqlcode=-420 sqlstate=22018,字符串自变量值不符合函数的要求,有没有高手给看看
SELECTA2.RELITEM,D.DATEFLAG,B.PRJIDFROMTBM_ACTIVITYA2,TBM_PRJDATAD,TBM_PRJACTIVITYB,B...
SELECT A2.RELITEM,D.DATEFLAG,B.PRJID
FROM TBM_ACTIVITY A2,TBM_PRJDATA D,TBM_PRJACTIVITY B,BAS_DPT D1,BAS_DPT D2
WHERE D.OBJECTID = B.ACTID AND B.PRJID=D.PRJID
AND D.DATEFLAG BETWEEN '201113' AND '201116' AND D.DATATYPE=1 AND D2.DPTID=INT(RTRIM(CHAR(1)))
AND B.ITEMID = 4164 AND D1.DPTID=INT(B.ITEMVALUE)
AND SUBSTR(D1.VIEWORDER,1,LENGTH(D2.VIEWORDER) )=(D2.VIEWORDER)
AND D.PRJID IN(SELECT A.PRJID FROM TBM_PRJLIST A,TBM_PRJLIST B WHERE A.PRJID=B.PRJID AND
B.ITEMID=4100 AND B.ITEMVALUE='0' AND A.ITEMID = 4103 AND A.ITEMVALUE IN (RTRIM('3')))
AND B.ACTID IN(SELECT ACTID FROM TBM_PRJACTIVITY WHERE ITEMID=4133 AND A2.ACTID=INT(ITEMVALUE))
AND D.ITEMID<>0
bas_dpt表中,dptid=1的部门vieworder的长度为2,把其中LENGTH(D2.VIEWORDER)换成2也报错,换成LENGTH(D2.VIEWORDER)-1或者1就没错了 展开
FROM TBM_ACTIVITY A2,TBM_PRJDATA D,TBM_PRJACTIVITY B,BAS_DPT D1,BAS_DPT D2
WHERE D.OBJECTID = B.ACTID AND B.PRJID=D.PRJID
AND D.DATEFLAG BETWEEN '201113' AND '201116' AND D.DATATYPE=1 AND D2.DPTID=INT(RTRIM(CHAR(1)))
AND B.ITEMID = 4164 AND D1.DPTID=INT(B.ITEMVALUE)
AND SUBSTR(D1.VIEWORDER,1,LENGTH(D2.VIEWORDER) )=(D2.VIEWORDER)
AND D.PRJID IN(SELECT A.PRJID FROM TBM_PRJLIST A,TBM_PRJLIST B WHERE A.PRJID=B.PRJID AND
B.ITEMID=4100 AND B.ITEMVALUE='0' AND A.ITEMID = 4103 AND A.ITEMVALUE IN (RTRIM('3')))
AND B.ACTID IN(SELECT ACTID FROM TBM_PRJACTIVITY WHERE ITEMID=4133 AND A2.ACTID=INT(ITEMVALUE))
AND D.ITEMID<>0
bas_dpt表中,dptid=1的部门vieworder的长度为2,把其中LENGTH(D2.VIEWORDER)换成2也报错,换成LENGTH(D2.VIEWORDER)-1或者1就没错了 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询