Exact error....

ORA-12801: error signaled in parallel query server P006

ORA-00001: unique constraint (EIM.BI_INVN_ITEM_WEEK_FACT_IDX1) violated

Index...

create index BI_INVN_ITEM_WEEK_FACT_IDX1 on BI_INVN_ITEM_WEEK_FACT (TO_CHAR(CAL_DATE,'MONTH'));

Table is partition by Month

Here is the insert statement....value for nBeginDate_Dim_id will be passed

insert /*+ append_values parallel(b)*/ into bi_invn_item_week_fact b

select /*+ parallel(a) */

(select min(d.date_dim_id) from Bi_Date_Dim d where d.fiscal_year = a.fiscal_year and d.fiscal_quarter = a.fiscal_quarter

and d.fiscal_month = a.fiscal_month and d.fiscal_week = a.fiscal_week),

a.store_dim_id,

a.item_dim_id,

a.fiscal_year,

a.fiscal_quarter,

a.fiscal_month,

a.fiscal_week,

avg(a.qty) avg_qty,

avg(a.ext_cost) avg_ext_cost,

avg(a.ext_price) avg_ext_price,

avg(a.ext_cost / nullif(a.qty, 0)) avg_unit_cost,

avg(a.ext_price / nullif(a.qty, 0)) avg_unit_price,

min(a.cal_date)

from bi_invn_item_day_fact a

where a.date_dim_id >= nBeginDate_Dim_id

and a.store_dim_id in (select store_dim_id from bi_store_dim where sbs_no = pSbsNo)

group by a.fiscal_year, a.fiscal_quarter, a.fiscal_month, a.fiscal_week, a.store_dim_id, a.item_dim_id;

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐