Constraints [message #184573] |
Thu, 27 July 2006 02:16 |
Yasir Hashmi
Messages: 304 Registered: April 2006
|
Senior Member |
|
|
Hey all,
Can anybody tell me the difference between constraints specified as NOT DEFERRABLE and Constraints specified by DEFERRABLE INITIALLY IMMEDIATE.
Thanks and Regards
Yasir Hashmi
|
|
|
|
Re: Constraints [message #184648 is a reply to message #184591] |
Thu, 27 July 2006 06:03 |
Yasir Hashmi
Messages: 304 Registered: April 2006
|
Senior Member |
|
|
Not Deferrable means constraint check immediately after every DML.
Deferred Initially Immediate means constraint check immediately after DML.
What is the defference in using the two?
Plz help.
Thanks and Regards
Yasir Hashmi
|
|
|
Re: Constraints [message #184652 is a reply to message #184648] |
Thu, 27 July 2006 06:15 |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
NOT DEFERRABLE: This constraint may not be set to DEFERRED, and is by implication, always applied at the time the DML is executed.
DEFERRABLE: This constraint may be deferred by using the SET CONSTRAINT command.
INITIALLY IMMEDIATE: The constraint is created with a current state of IMMEDIATE, meaning it is applied with the DML
INITIALLY DEFERRABLE: The constraint is created with a current state of DEFERRED, meaning it is applied when a commit is issued.
|
|
|
Re: Constraints [message #184686 is a reply to message #184573] |
Thu, 27 July 2006 08:15 |
Yasir Hashmi
Messages: 304 Registered: April 2006
|
Senior Member |
|
|
So if i have rightly understood DEFERRABLE can be set to NOT DEFERRABLE or IMMEDIATE as
SET CONSTRAINT constr_name DEFERRABLE INITIALLY IMMEDIATE;
but NOT DEFERRABLE or IMMEDIATE cannot be set as DEFERRABLE.
|
|
|
Re: Constraints [message #184687 is a reply to message #184686] |
Thu, 27 July 2006 08:17 |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
Correct.
A constraint that is created as DEFFERABLE can be set to either DEFFERED or IMMEDIATE.
Otherwise it must always be IMMEDIATE
|
|
|