Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Deleted a constraint but its still active???

GusoraJun 25 2007 — edited Jun 25 2007
SQL> Insert into JOB_HISTORY (EMPLOYEE_ID,START_DATE,END_DATE,JOB_ID,DEPARTMENT_ID) values (115,to_date('18-MAY-95',.....
Insert into JOB_HISTORY (EMPLOYEE_ID,START_DATE,END_DATE,JOB_ID,DEPARTMENT_ID) values (115,to_date('18-MAY-95','....
*
ERROR at line 1:
ORA-00001: unique constraint (HR.JHIST_EMP_ID_ST_DATE_PK) violated


SQL> select * from user_cons_columns where CONSTRAINT_NAME = 'JHIST_EMP_ID_ST_DATE_PK';

no rows selected

SQL> select * from user_cons_columns where table_name = 'JOB_HISTORY';

OWNER                          CONSTRAINT_NAME                TABLE_NAME                     COLUMN_NAME
------------------------------ ------------------------------ ------------------------------ -----------------------
HR                             JHIST_DATE_INTERVAL            JOB_HISTORY                    END_DATE
HR                             JHIST_DATE_INTERVAL            JOB_HISTORY                    START_DATE
HR                             JHIST_JOB_NN                   JOB_HISTORY                    JOB_ID
HR                             JHIST_END_DATE_NN              JOB_HISTORY                    END_DATE
HR                             JHIST_START_DATE_NN            JOB_HISTORY                    START_DATE
HR                             JHIST_EMPLOYEE_NN              JOB_HISTORY                    EMPLOYEE_ID
HR                             JHIST_DEPT_FK                  JOB_HISTORY                    DEPARTMENT_ID
HR                             JHIST_EMP_FK                   JOB_HISTORY                    EMPLOYEE_ID
HR                             JHIST_JOB_FK                   JOB_HISTORY                    JOB_ID

9 rows selected.

SQL> select * from all_cons_columns where CONSTRAINT_NAME = 'JHIST_EMP_ID_ST_DATE_PK';

no rows selected
Okay am a bit lost here as to what is going on. Have originally explicitly dropped the constraint 'JHIST_EMP_ID_ST_DATE_PK'. Did the above DML, got the error searched for the offending constraint...but its not there as far as the DB is concerned. What gives????


Gus
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 23 2007
Added on Jun 25 2007
9 comments
1,455 views