Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2014-12-10
2
Medium Priority
?
434 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
[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
2 Comments
 
LVL 25

Accepted Solution

by:
chaau earned 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
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…
Via a live example, show how to take different types of Oracle backups using RMAN.

636 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