Solved

ORA-30926: unable to get a stable set of rows in the source tables

Posted on 2013-01-30
4
1,321 Views
Last Modified: 2013-01-31
Hi,

I am doing a merge into statement across a database link and keep getting the ORA-30926 error: My merge into statement is below:
Any ideas - thanks for looking;

MERGE INTO sku_invn a
     USING sku_invn@wmsp b
        ON (a.sku_id = b.sku_id AND a.whse = b.whse)
WHEN MATCHED
THEN
   UPDATE SET
              a.INVN_TYPE = b.INVN_TYPE,
              a.PROD_STAT = b.PROD_STAT,
              a.BATCH_NBR = b.BATCH_NBR,
              a.SKU_ATTR_1 = b.SKU_ATTR_1,
              a.SKU_ATTR_2 = b.SKU_ATTR_2,
              a.SKU_ATTR_3 = b.SKU_ATTR_3,
              a.SKU_ATTR_4 = b.SKU_ATTR_4,
              a.SKU_ATTR_5 = b.SKU_ATTR_5,
              a.CNTRY_OF_ORGN = b.CNTRY_OF_ORGN,
              a.QTY_ON_HAND = b.QTY_ON_HAND,
              a.QTY_NOT_ALLOC = b.QTY_NOT_ALLOC,
              a.QTY_ALLOC = b.QTY_ALLOC,
              a.QTY_SOFT_ALLOC = b.QTY_SOFT_ALLOC,
              a.QTY_IN_INTRAN = b.QTY_IN_INTRAN,
              a.MGMT_ALLOC_INVN = b.MGMT_ALLOC_INVN,
              a.QTY_ALLOC_TO_BLNKT = b.QTY_ALLOC_TO_BLNKT,
              a.QTY_IN_WIP = b.QTY_IN_WIP,
              a.QTY_TO_BE_ALLOC = b.QTY_TO_BE_ALLOC,
              a.CREATE_DATE_TIME = b.CREATE_DATE_TIME,
              a.MOD_DATE_TIME = b.MOD_DATE_TIME,
              a.USER_ID = b.USER_ID
WHEN NOT MATCHED
THEN
   INSERT     (WHSE,
               SKU_ID,
               INVN_TYPE,
               PROD_STAT,
               BATCH_NBR,
               SKU_ATTR_1,
               SKU_ATTR_2,
               SKU_ATTR_3,
               SKU_ATTR_4,
               SKU_ATTR_5,
               CNTRY_OF_ORGN,
               QTY_ON_HAND,
               QTY_NOT_ALLOC,
               QTY_ALLOC,
               QTY_SOFT_ALLOC,
               QTY_IN_INTRAN,
               MGMT_ALLOC_INVN,
               QTY_ALLOC_TO_BLNKT,
               QTY_IN_WIP,
               QTY_TO_BE_ALLOC,
               CREATE_DATE_TIME,
               MOD_DATE_TIME,
               USER_ID)
       VALUES (b.WHSE,
               b.SKU_ID,
               b.INVN_TYPE,
               b.PROD_STAT,
               b.BATCH_NBR,
               b.SKU_ATTR_1,
               b.SKU_ATTR_2,
               b.SKU_ATTR_3,
               b.SKU_ATTR_4,
               b.SKU_ATTR_5,
               b.CNTRY_OF_ORGN,
               b.QTY_ON_HAND,
               b.QTY_NOT_ALLOC,
               b.QTY_ALLOC,
               b.QTY_SOFT_ALLOC,
               b.QTY_IN_INTRAN,
               b.MGMT_ALLOC_INVN,
               b.QTY_ALLOC_TO_BLNKT,
               b.QTY_IN_WIP,
               b.QTY_TO_BE_ALLOC,
               b.CREATE_DATE_TIME,
               b.MOD_DATE_TIME,
               b.USER_ID);
0
Comment
Question by:hraja77
  • 4
4 Comments
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 38834527
This error can come in the merge statement due to dupliate data in the tables. Can you verify whether there are any duplicates.

also have a look at this url

http://www.orafaq.com/forum/t/82086/2
0
 
LVL 28

Accepted Solution

by:
Naveen Kumar earned 500 total points
ID: 38834606
or instead of using "USING sku_invn@wmsp b", try with an inline view "USING (select ... from .. where ... ) " followed by ON (..)

just ensure that the inline view you are creating can pick up the data without duplicates after which your merge should be able to work fine. test it out.

Thanks
0
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 38834619
http://stackoverflow.com/questions/2337271/ora-30926-unable-to-get-a-stable-set-of-rows-in-the-source-tables - an example of how to use an inline view in the merge is shown in this url.
0
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 38838781
Good and thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now