ORA-12704: character set mismatch问题、以及处理wm_concat函数clob乱码问题
2015-12-25 16:17
543 查看
<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
相关文章推荐
- HTTP协议详解
- AFNetwork 3.0 源码解读  (一) 新版本的变化
- u3d工作中解决问题记录
- 百度地图接口说明链接
- weblogic myeclipse小知识
- storm初识印象
- EXCEL工作表保护密码忘记,撤销保护攻略
- lo4j2 日志保存进数据库,在window下运行正常,linux运行日常保存不进数据库的原因。
- [置顶] 大型网站技术架构(二)架构模式
- [置顶] 大型网站技术架构(二)架构模式
- ioS开发中plist文件的创建与简单读取
- 【android】TabActivity实现手指左右滑动切换tab
- 大型网站技术架构(二)架构模式
- 我的第一次份实习工作-iOS实习生-公司使用过的软件
- 代码整洁之道 读书笔记
- Hadoop 相关问题
- Java中的代码块
- Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused(MongoDB启动异常)
- android平台的开源框架的思考
- 图像处理算法基础(七)---形态学边界提取