Oracle cascade Constraints

Source: Internet
Author: User
Why can't pk, and col1 be DROPSQLCREATETABLEtest2 (2 pkNUMBERPRIMARYKEY, 3 fkNUMBER, 4col1NUMBER, 5col2NUMBER, round (fk) REFERENCEStest2, 7CONSTRAINTck1CHECK (pk0andcol10 ),

Why can't pk, and col1 drop SQL CREATE TABLE test2 (2 pk NUMBER PRIMARY KEY, 3 fk NUMBER, 4 col1 NUMBER, 5 col2 NUMBER, 6 CONSTRAINT fk_constraint FOREIGN KEY (fk) REFERENCES test2, 7 CONSTRAINT ck1 CHECK (pk 0 and col1 0), 8 CONSTRAINT ck2

Why can't pk, col1 DROP

SQL> CREATE TABLE test2 (
2 pk number primary key,
3 fk NUMBER,
4 col1 NUMBER,
5 col2 NUMBER,
6 CONSTRAINT fk_constraint foreign key (fk) REFERENCES test2,
7 CONSTRAINT ck1 CHECK (pk> 0 and col1> 0 ),
8 CONSTRAINT ck2 CHECK (col2> 0)
9)
10/

The table has been created.

SQL> ALTER TABLE test2 DROP (pk );
Alter table test2 DROP (pk)
*
Row 3 has an error:
ORA-12992: Unable to delete parent key keyword Column


SQL> ALTER TABLE test2 DROP (col1 );
Alter table test2 DROP (col1)
*
Row 3 has an error:
ORA-12991: referenced column in Multi-column Constraints


SQL> ALTER TABLE test2 DROP (fk );

The table has been changed.

SQL> alter table test2 drop (col2 );

The table has been changed.

SQL>

I really don't understand NLP

SQL> ALTER TABLE test2 DROP (fk );

The table has been changed.

SQL> alter table test2 drop (col2 );

The table has been changed.

SQL>

Why can't pk, col1 DROP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.