ORA-12704: character set mismatch问题、以及处理wm_concat函数clob乱码问题

<pre name="code" class="html">
在utf8数据库里编译存储过程,遇到这个问题.
oracle9206
sql: [做了简化]
select a from t1
union all
select '1' from t2;
其中t1.a是nvarchar2类型。

解决办法很简单:
select a from t1
union all
select N'1' from t2;


 
==============================================================
select em.devicename,
       to_char(em.faulttime, 'yyyy-mm-dd hh24:mi:ss') faulttime,
       et.enumname maintainstatus,
       (case
         when (em.DPLANREPAIRTIME >= em.drealrepairtime) or
              (sysdate < em.dplanrepairtime) then
          '及时'
         when (em.dplanrepairtime < em.drealrepairtime) or
              (em.drealrepairtime is null and em.dplanrepairtime < sysdate) then
          '不及时'
         when (em.dplanrepairtime is null and em.drealrepairtime is null and
              (em.faulttime + esl.finishtime / 24) > sysdate) then
          '及时'
         when (em.dplanrepairtime is null and em.drealrepairtime is null and
              (em.faulttime + esl.finishtime / 24) < sysdate) then
          '不及时'
       end) overdue,
       et1.enumname faultfrom,
       em.CBUGDETAIL,
       to_char((select wm_concat(to_char(eti.track_time,
                                        'yyyy-mm-dd hh24:mi:ss') || ' ' ||
                                eti.track_info || '【' || eti.track_man || '】')
                 from equip_maintain_tracking_info eti
                where eti.maintain_id = em.maintainid)) genjin,
       et2.enumname resultstatus, to_char(em.drealrepairtime, 'yyyy-mm-dd hh24:mi:ss') nworkhour,
       (case
         when sps.connection_name is null then
          ''
         else
          sps.connection_name || '-' || sps.connection_phone
       end) crepairid,
       et3.enumname faulttype
  from equip_maintain em
  left join enum_type et
    on et.enumvalue = em.maintain_status
   and et.enumtypeid = '75'
  left join enum_type et1
    on et1.enumvalue = em.fault_from
   and et1.enumtypeid = '74'
  left join enum_type et2
    on et2.enumvalue = em.result_status
   and et2.enumtypeid = '76'
  left join equip_service_level esl
    on esl.name = em.service_level
  left join Equip_Service_Provider_Sms sps
    on sps.id = em.crepairid
  left join enum_type et3
    on em.fault_type = et3.enumvalue
   and et3.enumtypeid = '77'
 where em.cequipid = '370200000000080004'
   and (em.result_status = 1 or em.result_status is null)
   and em.faulttime >= to_date('20151127', 'yyyymmdd')
   and em.faulttime <= to_date('20151226235959', 'yyyymmddhh24miss')
 order by em.faulttime desc

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值