惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
T
The Exploit Database - CXSecurity.com
C
CERT Recently Published Vulnerability Notes
P
Palo Alto Networks Blog
T
Threatpost
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
T
Tenable Blog
F
Full Disclosure
TaoSecurity Blog
TaoSecurity Blog
I
InfoQ
AI
AI
云风的 BLOG
云风的 BLOG
K
Kaspersky official blog
Microsoft Azure Blog
Microsoft Azure Blog
S
SegmentFault 最新的问题
Y
Y Combinator Blog
GbyAI
GbyAI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Privacy International News Feed
aimingoo的专栏
aimingoo的专栏
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell
I
Intezer
L
Lohrmann on Cybersecurity
博客园_首页
量子位
Blog — PlanetScale
Blog — PlanetScale
The Last Watchdog
The Last Watchdog
Cisco Talos Blog
Cisco Talos Blog
博客园 - 叶小钗
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Help Net Security
Help Net Security
Security Archives - TechRepublic
Security Archives - TechRepublic
Apple Machine Learning Research
Apple Machine Learning Research
W
WeLiveSecurity
N
News and Events Feed by Topic
S
Schneier on Security
T
Tor Project blog
MongoDB | Blog
MongoDB | Blog
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
T
Threat Research - Cisco Blogs
H
Help Net Security
V
V2EX
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Security @ Cisco Blogs
博客园 - Franky
有赞技术团队
有赞技术团队
Martin Fowler
Martin Fowler

博客园 - zqf620

.Net PetShop 3.0中购物车总价计算的bug .NET PetShop 3.0 FAQ .NET方向高级开发人员面试时应该事先考虑的问题 (zt) UML中的图 从一组数中每次抽取出一个数,并规定了每个数出现的概率 从一个表中随即抽取100条记录 PL/SQL User's Guide and Reference, Release 2 (9.2) chm版 下载 Oracle中实现自动增长列 在开发过程中运用UML 输出到html页面的字符串的格式化 在DataGrid控件中编辑数据项 在DataGrid控件中获取数据项中各列的数据内容 DataGrid控件的分页 DTD简介 W3C XML Schema (XSD) XML相关技术概览 将web窗体页文件(test.aspx)转换成用户控件文件(test.ascx) access作为后台数据库遇到的访问权限问题 HTML实体
novalidate选项无效的问题
zqf620 · 2007-02-04 · via 博客园 - zqf620

 novalidate选项无效的问题:       
平台:Oracle9i Enterprise Edition Release 9.2.0.1.0 for Windows

--创建一个带主键约束的表
create table temp(
temp_id number(3) constraint pk_temp primary key,
temp_desc varchar(20) );

--失效主键约束
alter table temp
disable constraint pk_temp;

--插入数据行
insert into temp values(1,'Record One');
insert into temp values(1,'Record Two');
insert into temp values(3,'Record Three');
insert into temp values(4,'Record Four');

--提交
commit;

--使用novalidate选项启用约束
alter table temp
enable novalidate constraint pk_temp;


================================================================
上面这一句报错,why?
alter table temp
*
ERROR at line 1:
ORA-02437: cannot validate (TSP3.PK_TEMP) - primary key violated
=================================================================

--解答:
--因为主键约束没有被定义为可延迟的(deferrable)
--所以,即使使用novalidate启用约束,还是会表的数据上应用约束

---------------------------------
--解决方案:
--删除主键约束
alter table temp
drop primary key keep index;

--重新添加主键约束,状态为可延迟、禁用
alter table temp
add constraint pk_temp primary key(temp_id) deferrable disable;

--使用带novalidate选项来启用约束
alter table temp
enable novalidate constraint pk_temp;

--一切ok