can't delete foreign and primary key

osama

can't delete the primary and foreign key, it's simple table but i don't why this error

create table student (
    s_ID int ,
    S_NAMe varchar2 (10),
    S_major varchar2(20),
    D_ID number (10) ,
    Constraint PK_s_ID primary key (s_ID), 
    constraint FK_D_ID foreign key (D_ID) references dep (D_ID) );

    ALTER TABLE student DROP CONSTRAINT PK_s_ID cascade;
    alter table student drop constraint FK_D_ID;

    ERROR at line 1:
    ORA-02443: Cannot drop constraint  - nonexistent constraint
kamoor

You SQL commands looks correct. You can use following command to make sure constraint exists.

SELECT * FROM user_cons_columns WHERE table_name = 'STUDENT'

If it returns no result, that means you either did not create a constraint or already dropped. You may be trying to re-run the same alter command more than once.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

can't Delete a foreign key

From Dev

Delete foreign key with primary key reference

From Dev

A foreign key can be primary in sql

From Dev

Can a foreign key act as a primary key?

From Dev

Can a foreign key be the only primary key

From Dev

Can a foreign key also be used as primary key?

From Dev

Can't delete primary key on table with FULLTEXT index

From Dev

can't delete object due to foreign key constraint

From Dev

HIbernate Can't delete Entity with foreign key. Foreign key gets set to null

From Dev

Delete all foreign key data on delete of primary or vice-a-versa

From Dev

Can a unique key ( not a primary key) be a foreign key to other table?

From Dev

Understanding how a Primary Key of one Table can be a Foreign Key too

From Java

Can a foreign key refer to a primary key in the same table?

From Dev

Can a foreign key refer to the primary key of its own table?

From Dev

Foreign Key to Primary key relation

From Dev

foreign key is not equal to primary key

From Dev

Find foreign key by primary key?

From Dev

Replacing a foreign key by a primary key

From Dev

Can we have two primary keys in one Foreign key field?

From Dev

t-sql 2012 update foreign key value in primary table

From Dev

How to delete a row in a table with a primary key, without deleting the value of anothers table Foreign Key?

From Dev

Use foreign keys as primary key

From Dev

Foreign and Primary Key Conceptual Questions

From Dev

Primary & Foreign Key Constraints Confusion

From Dev

Hibernate Primary Foreign Key field

From Dev

create primary and foreign key relationship

From Dev

Two foreign keys as primary key

From Dev

Hibernate Primary Foreign Key field

From Dev

Finding Primary Table for a Foreign Key

Related Related

  1. 1

    can't Delete a foreign key

  2. 2

    Delete foreign key with primary key reference

  3. 3

    A foreign key can be primary in sql

  4. 4

    Can a foreign key act as a primary key?

  5. 5

    Can a foreign key be the only primary key

  6. 6

    Can a foreign key also be used as primary key?

  7. 7

    Can't delete primary key on table with FULLTEXT index

  8. 8

    can't delete object due to foreign key constraint

  9. 9

    HIbernate Can't delete Entity with foreign key. Foreign key gets set to null

  10. 10

    Delete all foreign key data on delete of primary or vice-a-versa

  11. 11

    Can a unique key ( not a primary key) be a foreign key to other table?

  12. 12

    Understanding how a Primary Key of one Table can be a Foreign Key too

  13. 13

    Can a foreign key refer to a primary key in the same table?

  14. 14

    Can a foreign key refer to the primary key of its own table?

  15. 15

    Foreign Key to Primary key relation

  16. 16

    foreign key is not equal to primary key

  17. 17

    Find foreign key by primary key?

  18. 18

    Replacing a foreign key by a primary key

  19. 19

    Can we have two primary keys in one Foreign key field?

  20. 20

    t-sql 2012 update foreign key value in primary table

  21. 21

    How to delete a row in a table with a primary key, without deleting the value of anothers table Foreign Key?

  22. 22

    Use foreign keys as primary key

  23. 23

    Foreign and Primary Key Conceptual Questions

  24. 24

    Primary & Foreign Key Constraints Confusion

  25. 25

    Hibernate Primary Foreign Key field

  26. 26

    create primary and foreign key relationship

  27. 27

    Two foreign keys as primary key

  28. 28

    Hibernate Primary Foreign Key field

  29. 29

    Finding Primary Table for a Foreign Key

HotTag

Archive