问题描述
我们在windows上使用db2 v8.2 EE,使用jcc驱动程序。尝试创建
a加入视图,之后我检查syscat.columns表,对于那些
十进制字段使用COALESCE方法,所有长度变为11而不是
表中字段的实际长度,任何人都可以解释这个吗?
我?谢谢
创建视图ML101PD.ARJMBAL1(ARNM05,ARNO01,ARNM01,ARNO07,ARNO08,
ARNO09,ARFL17,ARFL03,ARMO12,ARDY12,ARCC12, ARYR12,ARNO15,
systimestamp,loginname,id)选择ML101PD.ARPMCUS.ARNM05,
ML101PD.ARPMCUS.ARNO01,ML101PD.ARPMCUS.ARNM01,ML101PD.ARPMCUS。 ARNO07,
ML101PD.ARPMCUS.ARNO08,ML101PD.ARPMCUS.ARNO09,
COALESCE(ML101PD.ARPMBAL.ARFL17,'''),COALESCE(ML101PD.ARPMBAL。 ARFL03,
'''',COALESCE(ML101PD.ARPMBAL.ARMO12,0),
COALESCE(ML101PD.ARPMBAL.ARDY12,0),COALESCE(ML101PD。 ARPMBAL.ARCC12,
0),COALESCE(ML101PD.ARPMBAL.ARYR12,0),
COALESCE(ML101PD.ARPMBAL.ARNO15,0),ML101PD.ARPMBAL.systimestamp ,
$ ML $ b来自ML101PD.ARPMCUS的ML101PD.ARPMBAL.loginname,COALESCE(ML101PD.ARPMCUS.id,
ML101PD.ARPMBAL.id)在
ML101PD.ARPMCUS.ARNO01 = ML101PD.ARPMBAL.ARNO01其中
((ML101PD.ARPMBAL .ARFL03 =''Y''))和((ML101PD.ARPMBAL.ARFL17<>''C''))
we are using db2 v8.2 EE on windows, with jcc driver. try to create
a join view, after that i check the syscat.columns table, for those
decimal field use COALESCE method, all the length become 11 instead of
the actual length of the field inside table, can anyone explain this to
me ? thank you
create view ML101PD.ARJMBAL1 (ARNM05, ARNO01, ARNM01, ARNO07, ARNO08,
ARNO09, ARFL17, ARFL03, ARMO12, ARDY12, ARCC12, ARYR12, ARNO15,
systimestamp, loginname, id ) as select ML101PD.ARPMCUS.ARNM05,
ML101PD.ARPMCUS.ARNO01, ML101PD.ARPMCUS.ARNM01, ML101PD.ARPMCUS.ARNO07,
ML101PD.ARPMCUS.ARNO08, ML101PD.ARPMCUS.ARNO09,
COALESCE(ML101PD.ARPMBAL.ARFL17, '' ''), COALESCE(ML101PD.ARPMBAL.ARFL03,
'' ''), COALESCE(ML101PD.ARPMBAL.ARMO12, 0),
COALESCE(ML101PD.ARPMBAL.ARDY12, 0), COALESCE(ML101PD.ARPMBAL.ARCC12,
0), COALESCE(ML101PD.ARPMBAL.ARYR12, 0),
COALESCE(ML101PD.ARPMBAL.ARNO15, 0), ML101PD.ARPMBAL.systimestamp,
ML101PD.ARPMBAL.loginname, COALESCE(ML101PD.ARPMCUS.id,
ML101PD.ARPMBAL.id ) from ML101PD.ARPMCUS left join ML101PD.ARPMBAL on
ML101PD.ARPMCUS.ARNO01 = ML101PD.ARPMBAL.ARNO01 where
((ML101PD.ARPMBAL.ARFL03=''Y'')) and ((ML101PD.ARPMBAL.ARFL17<>''C''))
推荐答案
这篇关于使用coalesce()后的奇怪问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!