ORA-30926 unable to get a stable set of rows in the source tables
7537Jul 29 2005 — edited Jul 29 2005I have a global temporary table that I load. After it is loaded, I insert the rows into a permanent table, then I use the same data to inset into another table with a group by for totals Then I am using the following code to do a merge for monthly totals. I am having a problem with the error in the subject. It does not happen all the time which makes it harder to figure out. We are running on Database 10g Enterprise Edition Release 10.1.0.4.0 - 64bit Production. Can anyone help me with this.
MERGE INTO flash_exp_rpt_dtl D
USING
(SELECT 'RNMNTH' detail_type,
SITE_CODE
V_DATE DETAIL_DATE,
CATEGORY,
MPC,
UOM,
CATEGORY_ITEM_ID,
CURRENT_UNIT_COST,
PERIOD_RCVD_QTY,
PERIOD_RCVD_AMT,
PERIOD_MISC_ADJ_AMT,
UPD_DTS,
UPD_BY,
SENT_WHSE_IND
FROM pricebk.flash_exp_gtemp) F
ON (d.category = f.category
AND d.site_CODE = f.site_code
AND d.detail_date = f.detail_date
AND d.detail_type = f.detail_type
AND d.category_item_id = f.category_item_id)
WHEN MATCHED THEN
UPDATE SET
PERIOD_RCVD_QTY = PERIOD_RCVD_QTY + F.PERIOD_RCVD_QTY,
PERIOD_RCVD_AMT = PERIOD_RCVD_AMT + f.PERIOD_RCVD_AMT,
PERIOD_MISC_ADJ_AMT = PERIOD_MISC_ADJ_AMT + f.PERIOD_MISC_ADJ_AMT,
upd_dts = sysdate,
upd_by = user,
SENT_WHSE_IND = 'N',
whse_upd_date = NULL
WHEN NOT MATCHED THEN
INSERT
VALUES
( F.detail_type,
f.site_code,
f.detail_date,
f.CATEGORY,
f.MPC,
f.UOM,
f.category_item_id,
NULL,
F.CURRENT_UNIT_COST,
F.PERIOD_RCVD_QTY,
NVL(f.PERIOD_RCVD_AMT,0),
NVL(f.period_misc_adj_amt,0),
F.UPD_DTS,
F.UPD_BY,
F.SENT_WHSE_IND,
NULL);