Solved

ORA-30926 on Merge script

Posted on 2009-04-09
3
923 Views
Last Modified: 2013-12-18
ORA-30926: unable to get a stable set of rows in the source tables

Hello everyone I am back. i am getting a ORA-30926 on the below merge script. I had this working but for some reason I am getting this now. I have looked all over the web and I can not figure out why. Can some please give me some direction on what might be going on?


Any help would be great.
MERGE INTO TEST.CONTCT D

USING         (select WHOLENAME, FIRST_NAME, LAST_NAME, ADUSERNAME, EMAIL, PHONENUMBER, LOCATION1, DEPARTMENT, COMPANY, STATUS, LOCATION_L7

               from (

                      SELECT P7.WHOLENAME, P7.FIRST_NAME, P7.LAST_NAME, P7.ADUSERNAME, P7.EMAIL, P7.PHONENUMBER, 

                             P7.LOCATION1, P7.DEPARTMENT, P7.COMPANY, P7.STATUS,L7."LOCATION" AS LOCATION_L7,

                             row_number() over(partition by P7.ADUSERNAME order by P7.ADUSERNAME) AS RN

                       FROM LNOTES_EXP P7, TEST.LOCM1 L7

                       WHERE L7.LOCATION_NAME = P7.LOCATION1

                       AND P7.ADUSERNAME is not null

                     )

                where RN = 1

              ) P

ON  

           (UPPER(P.ADUSERNAME) = D.CONTACT_NAME)

WHEN MATCHED THEN

              UPDATE

              SET  

                              D.FULL_NAME = P.WHOLENAME,                            

                              D.FIRST_NAME = P.FIRST_NAME,

                              D.LAST_NAME = P.LAST_NAME,

                              D.EMAIL = P.EMAIL,

                              D.CONTACT_PHONE = P.PHONENUMBER,

                              D."LOCATION" = P.LOCATION_L7 ,                                  

                              D.DEPT_NAME = P.DEPARTMENT ,

                              D.COMPANY  = 'EMG',

                              D.ACTIVE  = DECODE(UPPER(P.STATUS),'ACTIVE','Y','N')

WHEN NOT MATCHED THEN 

              INSERT

              (D.FULL_NAME, D.CONTACT_NAME, D.USER_ID, D.FIRST_NAME, D.LAST_NAME, D.OPERATOR_ID,

               D.EMAIL, D.CONTACT_PHONE  ,D."LOCATION", D.DEPT_NAME, D.COMPANY,

               D.ACTIVE)

               VALUES

              (P.WHOLENAME, UPPER(P.ADUSERNAME), UPPER(P.ADUSERNAME), P.FIRST_NAME, P.LAST_NAME, P.ADUSERNAME, P.EMAIL, 

               P.PHONENUMBER, P."LOCATION_L7", P.DEPARTMENT, 'EMG', DECODE(UPPER(P.STATUS),'ACTIVE','Y','N'));

                 

COMMIT;

Open in new window

0
Comment
Question by:rleni59
3 Comments
 
LVL 16

Accepted Solution

by:
Milleniumaire earned 250 total points
Comment Utility
This is usually caused by attempting to perform multiple updates of the same row in the destination table:

    ORA-30926: unable to get a stable set of rows in the source tables
        Cause: A stable set of rows could not be got because of large dml
               activity or a non-deterministic where clause.
       Action: Remove any non-deterministic where clauses and reissue the dml.

It is possible, though, to aggregate the results in an inline view in the USING clause.
0
 
LVL 18

Assisted Solution

by:sventhan
sventhan earned 250 total points
Comment Utility
0
 
LVL 1

Author Comment

by:rleni59
Comment Utility
The final solution was to create a unique index on the LNOTES_EXP table. Once created it worked. Pretty much what the article was saying.
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

Suggested Solutions

Title # Comments Views Activity
Delphi selector screen 2 57
Right Function in Oracle SQL Query 6 49
Adding a blank row when using union all 4 49
sql query 9 18
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…
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 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 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

763 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

11 Experts available now in Live!

Get 1:1 Help Now