Solved

ORA-30926: UNABLE TO GET A STABLE SET OF ROWS IN THE SOURCE TABLES

Posted on 2014-12-10
2
383 Views
Last Modified: 2014-12-22
hi am having this error when meging two tables
am in 11gR2
error is ORA-30926: UNABLE TO GET A STABLE SET OF ROWS IN THE SOURCE TABLES

create table CAL_OBJ
(
  obj_name    VARCHAR2(100) not null,
  obj_type    VARCHAR2(50),
  obj_title   VARCHAR2(50),
  description VARCHAR2(500),
  sub_system  VARCHAR2(100),
  status      VARCHAR2(20)
);


create table OBJTEST
(
  obj_name    VARCHAR2(100),
  obj_type    VARCHAR2(50),
  obj_title   VARCHAR2(50),
  description VARCHAR2(500),
  sub_system  VARCHAR2(100),
  status      VARCHAR2(20)
);

merge into cal_obj e1
      using objtest e2
      on (e1.obj_name = e2.obj_name)
when matched then update set e1.description    = e2.description,
                             e1.sub_system     = e2.sub_system
        when not matched then insert
         values (e2.obj_name, e2.obj_type, null, e2.description,e2.sub_system,null);

Open in new window

0
Comment
Question by:chalie001
2 Comments
 
LVL 24

Accepted Solution

by:
chaau earned 500 total points
ID: 40493061
Your on clause  on (e1.obj_name = e2.obj_name) does not provide the uniqueness. There are records in either tables with the duplicate obj_name. You need to fix your data by removing the duplicates or by using a stricter condition in the ON clause. BTW, I can see that the tables are without any primary keys or indexes. It does not look right. You need to start thinking about re-designing it.
0
 

Author Closing Comment

by:chalie001
ID: 40513615
correct answer
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

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…
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

762 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

24 Experts available now in Live!

Get 1:1 Help Now