SUMSEN

Oracle&Sql爱好者,用友NC管理员

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

总一 借工程结算负数 贷工程结算对冲问题

oralce使用聚合函数wmsys.wm_concat字段显示 clob :应该是,10.2.0.4以前,是varchar2,10.2.0.5开始,是CLOB 这是一个bug,当lob字段和order by 同时出现时可能触发 可以打上对应的补丁,或者,只要不超过4000字节,可以加个to_char来转换成字符串试试 

select gl_detail.explanation,
      bd_accsubj.subjcode,
      bd_accsubj.dispname,       
       gl_detail.debitamount 借方,   
        gl_detail.creditamount 贷方,
        gl_detail.prepareddatev 制单日期 , 
       gl_voucher.no 凭证号, 
       to_char(wmsys.wm_concat(gl_freevalue.valuecode)) valuecode,
        to_char(wmsys.wm_concat(gl_freevalue.valuename)) valuename
         from gl_detail, bd_accsubj, bd_glorgbook,gl_freevalue,gl_voucher
 where gl_detail.pk_accsubj = bd_accsubj.pk_accsubj
   and gl_detail.pk_glorgbook = bd_glorgbook.pk_glorgbook
   and   gl_detail.assid=gl_freevalue.freevalueid
   and gl_detail.pk_voucher=gl_voucher.pk_voucher
   and gl_detail.dr = '0'
   and gl_detail.yearv='2014'
   and bd_glorgbook.glorgbookcode = '015101-0001'
   and bd_accsubj.subjcode like '2123%' 
   and  gl_detail.creditamount<0
   group by gl_detail.explanation,
   bd_accsubj.subjcode,
         bd_accsubj.dispname,       
       gl_detail.creditamount,
       gl_detail.debitamount,   
         gl_detail.prepareddatev,gl_voucher.no
  order by gl_detail.prepareddatev,gl_voucher.no

posted on 2015-08-21 09:40  sumsen  阅读(516)  评论(0编辑  收藏  举报