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 8138319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:27:18+00:00 2026-06-06T11:27:18+00:00

I work with Oracle 11g. I have one table: create table test (one number(2),

  • 0

I work with Oracle 11g.
I have one table:

create table test (one number(2), two number(2));

There are 2 rows:

insert into test (one, two) values (1, 1);
insert into test (one, two) values (2, null);
commit;

Now I create an exceptions table:

create table exceptions(row_id rowid,
                       owner varchar2(30),
                       table_name varchar2(30),
                       constraint varchar2(30));

Now I want to create the primary key for test:

alter table test add constraint test_pk primary key (one, two) exceptions into exceptions;

Of course I get the following error: ORA-01449

But the row that caused the exception is not in the exception table?

Can anybody help me. Thanks in advance

Wolfgang

  • 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-06T11:27:20+00:00Added an answer on June 6, 2026 at 11:27 am

    In order to do this, you must first create the constraint disabled:

    ALTER TABLE test ADD CONSTRAINT test_pk PRIMARY KEY (one, two) DISABLE;
    

    Then, enable the constraint with exceptions:

    ALTER TABLE TEST ENABLE CONSTRAINT test_pk EXCEPTIONS INTO exceptions;
    

    Then you can select the results:

    SQL> SELECT * FROM EXCEPTIONS;
    
    ROW_ID             OWNER TABLE_NAME CONSTRAINT
    ------------------ ----- ---------- ----------
    AAHpV4AAHAAApliAAB XXX   TEST       TEST_PK
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two databases I need to work with, one oracle on a remote
I have setup a simple Oracle external table test that I (alongside a DBA
I'm using Oracle 11g, and trying to create a table define constraints on the
DB: Oracle 11g Is there a way to do something like the following: INSERT
We work as a third party with MVC traditional framework with oracle 11g (no
At work I have an app sitting on Oracle 7.3 (old stuff, yes). Recently
I have to use oracle database in android. I have tried to work as
I have 3 tables, one which represents a supertype, with an ID column. Two
I have a large (multi-GB) data file exported from an Oracle table. I want
I have an SQL MERGE statement working perfectly in Oracle 11g (development environment), but

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.