oracle存储过程中怎么把参数传入表名中

2024-12-17 14:39:49
推荐回答(1个)
回答1:

这样试试:

v_sql:='insert into sz_ym_hwltj_'||v_date||

'(
-----市话
select ''sh'',''朔州新局D1'',start_date,count(distinct msisdn),count(*),sum

(discount_cfee)/1000,sum(trunc((call_duration+59)/60)) from
(select * from ucr_sz1.tg_cdr||v_month_fix@dblnk_ngbil
union all
select * from ucr_sz2.tg_cdr||v_month_fix@dblnk_ngbil)
where msc in (''34917'',''34918'')
and reserver1 in

(110,112,113,114,115,123,125,128,129,160,161,163,164,165,170,172,173,178,

350,352,354,356,358,311,312,314,316,304)
and trunk_groupin in (''0203'',''0205'') and

partition_id=v_day
group by start_date
)';