Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Cannot open form error 6 63
one-way data "masking" MD5 sql 26 145
case statement in where clause with not exist 15 46
Oracle - Create Procedure with Paramater 16 55
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…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

947 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

22 Experts available now in Live!

Get 1:1 Help Now