Oracle 级联约束
为什么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
为什么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 /
表已创建。
SQL> ALTER TABLE test2 DROP (pk);
ALTER TABLE test2 DROP (pk)
*
第 1 行出现错误:
ORA-12992: 无法删除父项关键字列
SQL> ALTER TABLE test2 DROP (col1);
ALTER TABLE test2 DROP (col1)
*
第 1 行出现错误:
ORA-12991: 引用的列处于多列约束条件
SQL> ALTER TABLE test2 DROP (fk);
表已更改。
SQL> alter table test2 drop (col2);
表已更改。
SQL>
实在不理解 ↓
SQL> ALTER TABLE test2 DROP (fk);表已更改。
SQL> alter table test2 drop (col2);
表已更改。
SQL>
为什么pk、和col1 不能DROP

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Do you want to know how to display child categories on the parent category archive page? When you customize a classification archive page, you may need to do this to make it more useful to your visitors. In this article, we will show you how to easily display child categories on the parent category archive page. Why do subcategories appear on parent category archive page? By displaying all child categories on the parent category archive page, you can make them less generic and more useful to visitors. For example, if you run a WordPress blog about books and have a taxonomy called "Theme", you can add sub-taxonomy such as "novel", "non-fiction" so that your readers can

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

MongoDB is suitable for unstructured data and high scalability requirements, while Oracle is suitable for scenarios that require strict data consistency. 1.MongoDB flexibly stores data in different structures, suitable for social media and the Internet of Things. 2. Oracle structured data model ensures data integrity and is suitable for financial transactions. 3.MongoDB scales horizontally through shards, and Oracle scales vertically through RAC. 4.MongoDB has low maintenance costs, while Oracle has high maintenance costs but is fully supported.

Factors of rising virtual currency prices include: 1. Increased market demand, 2. Decreased supply, 3. Stimulated positive news, 4. Optimistic market sentiment, 5. Macroeconomic environment; Decline factors include: 1. Decreased market demand, 2. Increased supply, 3. Strike of negative news, 4. Pessimistic market sentiment, 5. Macroeconomic environment.

Understand the randomness of circular dependencies in Spring project startup. When developing Spring project, you may encounter randomness caused by circular dependencies at project startup...

MySQL is suitable for rapid development and small and medium-sized applications, while Oracle is suitable for large enterprises and high availability needs. 1) MySQL is open source and easy to use, suitable for web applications and small and medium-sized enterprises. 2) Oracle is powerful and suitable for large enterprises and government agencies. 3) MySQL supports a variety of storage engines, and Oracle provides rich enterprise-level functions.

Choosing MySQL or Oracle depends on project requirements: 1. MySQL is suitable for small and medium-sized applications and Internet projects because of its open source, free and ease of use; 2. Oracle is suitable for core business systems of large enterprises because of its powerful, stable and advanced functions, but at a high cost.

Concordium: A public first-level blockchain platform that takes into account privacy and compliance is a public first-level blockchain platform. Its core lies in the clever integration of identity verification with privacy and regulatory compliance. Founded in 2018 by Lars Seier Christensen, the platform’s core technology embeds cryptographic identities at the protocol level of each transaction. This unique design ensures responsibility traceability while protecting user privacy, effectively solving the problem of conflicts between anonymity and regulatory requirements in the blockchain field. To alleviate this problem, Concordium utilizes Zero Knowledge Proof (ZKP) technology, allowing users to verify specific identity attributes without the need to disclose unnecessary personal information. This means that, despite every
