?
Solved

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

Posted on 2014-12-10
2
Medium Priority
?
427 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
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…
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.
Suggested Courses

765 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