Solved

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

Posted on 2013-01-30
4
1,360 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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
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 shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

770 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