查看: 7927|回复: 2

请问constraint中:not deferrable与 deferrable initially immediate 有何区别?谢谢

[复制链接]
论坛徽章:
3
ITPUB元老
日期:2005-02-28 12:57:00授权会员
日期:2005-10-30 17:05:33会员2006贡献徽章
日期:2006-04-17 13:46:34
跳转到指定楼层
1#
发表于 2001-11-23 14:57 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
创建constraint时有这样一个选项:

not deferrable | deferrable [ initially { immediate | deferred } ]

------------------
not deferrable与 deferrable initially immediate

岂不都是check at the end of every DML statement,

请问两种状态有何区别?谢谢各位前辈。
论坛徽章:
3
生肖徽章2007版:鸡
日期:2008-01-02 17:35:53生肖徽章2007版:鼠
日期:2008-01-02 17:35:53ITPUB十周年纪念徽章
日期:2011-11-01 16:20:28
2#
发表于 2004-12-14 14:25 | 只看该作者
not deferrable 与initially immediate是一样的,与deferrable initially immediate则不同。后者允许将constraint再改为initially deferred, 前者不允许更改:
>create table test2 (f1 number(3) constraint fk references test(f1) initially immediate);
>alter table test2 modify constraint fk initially deferred;
alter table test2 modify constraint fk initially deferred
*
ERROR 位于第 1 行:
ORA-02447: 无法延迟不可延迟的约束条件

> create table test2 (f1 number(3) constraint fk references test(f1) deferrable initially immediate);
> alter table test2 modify constraint fk initially deferred;
表已更改。

使用道具 举报

回复
论坛徽章:
15
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:442014年新春福章
日期:2014-02-18 16:41:11ITPUB十周年纪念徽章
日期:2011-11-01 16:20:28ITPUB元老
日期:2011-05-06 08:54:442011新春纪念徽章
日期:2011-02-18 11:43:32ITPUB9周年纪念徽章
日期:2010-10-08 09:28:512010新春纪念徽章
日期:2010-03-01 11:04:59生肖徽章2007版:鼠
日期:2009-03-10 21:32:40生肖徽章2007版:猪
日期:2009-03-10 21:17:25CTO参与奖
日期:2009-01-15 11:42:46
3#
发表于 2008-2-19 09:56 | 只看该作者
学习

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表