select i.code,(case when i.code='50001' then '服務采集頻率' else '主機采集頻率' end)name, decode(i.start_time,'','-',null,'-',to_char(i.start_time,'yyyy-mm-dd hh24:mi:ss'))start_time, nvl(i.interval,'-')interval, nvl(i.overtime,'-')overtime, nvl(i.createby,'-')createby from moni_cfg_clt_interval i where i.code in(50001,50014)
這樣取的話,name只會取到第一個字符,“服”或“主”
原因是類型長度問題的,默認是java.lang.character
改正為:
select i.code,to_multi_byte((case when i.code='50001' then '服務采集頻率' else '主機采集頻率' end))name,"+ decode(i.start_time,'','-',null,'-',to_char(i.start_time,'yyyy-mm-dd hh24:mi:ss'))start_time, nvl(i.interval,'-')interval, nvl(i.overtime,'-')overtime, nvl(i.createby,'-')createby from moni_cfg_clt_interval i where i.code in(50001,50014)
