Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-01-30
4
Medium Priority
?
1,428 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to recover a database from a user managed backup

722 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