Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9003343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:41:59+00:00 2026-06-16T00:41:59+00:00

I’m trying to load the below table using SQL. In my Ldirectory table I

  • 0

I’m trying to load the below table using SQL. In my Ldirectory table I have the combination of SY and LIDENTIFIER as primary key and I’m trying to run this query

insert into S_User.LDIRECTORY (SY,LIDENTIFIER,ONAME,TELNUMBER) 
select  2013,D.CODE, D.NAME, D_YEAR.PHONE_NUMBER       
from    WHS.D   WHS.D_YEAR   
where   WHS.D.D_KEY=WHS.D_YEAR.D_KEY

and the error that I’m receiving is:

SQL Error ORA-00001 unique constraint violated

Cause:    An UPDATE or INSERT statement attempted to insert a duplicate key.
           For Trusted Oracle configured in DBMS MAC mode, you may see
           this message if a duplicate entry exists at a different level.
Action:   Either remove the unique restriction or do not insert the key.

How can I solve this issue? I think during the insertion its treating the SY column as primary key itself but I have just one same value for that column.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:41:59+00:00Added an answer on June 16, 2026 at 12:41 am

    The error message should indicate the name of the unique constraint that was violated. Assuming the constraint in question is the primary key rather than some other unique constraint defined on the table and assuming that the primary key constraint is a composite constraint defined on the combination of SY and LIDENTIFIER as you indicate, that implies that your query is returning duplicate rows.

    The query you are running returns a hard-coded value of 2013 for SY. So you would expect the constraint to be violated if there are any two rows in the result where D.CODE are the same. Are you certain that you expect D.CODE to be unique across the entire result set? It’s hard to guess based on the names of the objects (no idea what D might represent, no idea why D_YEAR would have a PHONE_NUMBER column, etc) but I would tend to guess that one row in D might map to multiple rows in D_YEAR in which case there would be multiple rows in the result that had the same D.CODE value thus violating the constraint.

    If you are convinced that the query should not return any two rows with the same D.CODE value, you could use DML error logging to write the rows that violate the constraint to an error table so that you could analyze the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Does anyone know how can I replace this 2 symbol below from the string
I have thousands of HTML files to process using Groovy/Java and I need to
I am trying to loop through a bunch of documents I have to put

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.