oracle 字符串大于,字符串超过 4000 问题!

丁俊大哥,不明白你说的存储过程将类型改为CLOB,你的意思是改f_str2list里面的参数类型吗,这个我已经改了,但还是哪个问题,我把我的调用函数的SQL直接贴出来吧,你帮我看看。。。。。%>_

with t1 as (

select distinct cuid,label_cn,location_city,system_sysservices from a

union

select distinct cuid,label_cn,location_city,system_sysservices from b

union

select distinct cuid,label_cn,location_city,system_sysservices from c

)

,t2 as (

select a.cuid,a.if_desc,t1.location_city,t1.system_sysservices

from 端口 a,t1

where a.related_dev = t1.cuid

)

select to_char(b.org_time,'yyyy-mm-dd') org_time,t2.cuid,t2.if_desc,t2.location_city,

t2.system_sysservices,b.ifspeed,b.avgifinoctets_speed,

b.AVGIFINBandwidth_RATE,b.AVGIFOUTOCTETS_SPEED,b.AVGIFOutBandwidth_RATE,b.MAXIFINOCTETS_SPEED,

b.MAXIFINBandwidth_RATE,b.MAXIFOUTOCTETS_SPEED,b.MAXIFOutBandwidth_RATE

from t2,RPT_NETWORK_INTERFACE_DAY b,table(cast(f_str2list(to_clob(?)) as t_str2list)) d    -- 函数的调用,问号代表哪个字符串

where replace(t2.cuid,':','#') = b.object_key

and b.ORG_TIME >= to_date(?,'yyyy-mm-dd')

and b.ORG_TIME

and t2.cuid = d.column_value

order by to_char(b.org_time,'yyyy-mm-dd') ASC,t2.cuid,t2.if_desc

函数:f_str2list

CREATE OR REPLACE function f_str2list (v_str in clob) return t_str2list

as

vv_str  clob default v_str || ',' ;

v_count number;

v_t_str2list t_str2list := t_str2list();

begin

loop

v_count := instr(vv_str,',');

exit when (nvl(v_count,0) = 0);

v_t_str2list.extend;

v_t_str2list(v_t_str2list.count) := ltrim(rtrim(substr(vv_str,1,v_count-1)));

vv_str := substr(vv_str,v_count+1);

end loop;

return v_t_str2list;

end;

/

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值