Re: Declaring Unenforced Constraints

From: Lennart Jonsson <lennart_at_kommunicera.umea.se>
Date: 6 Nov 2004 10:47:09 -0800
Message-ID: <6dae7e65.0411061047.28aa5506_at_posting.google.com>


"Laconic2" <laconic2_at_comcast.net> wrote in message news:<yrudnS4h2tqFSBbcRVn-jg_at_comcast.com>...
> "Paul" <paul_at_test.com> wrote in message
> news:418bd2af$0$524$ed2619ec_at_ptn-nntp-reader03.plus.net...
>
> > SQL Server has this as well, at least for foreign keys.
> >
> > It can be useful if you're loading in a massive amount of data from an
> > online system to a reporting system and you don't want to worry about
> > having to load the tables in a specific order or to have the whole thing
> > crash at the start due to a small broken key constraint.
>
> Thanks to you and to Tony for bringing me up to date on SQL Server and
> Oracle. How about DB2, anyone?
>

In DB2 you can choose wether you want the optimizer to use a constraint or not. You can also choose whether a constraint should be enforced or not.

alter table X1 alter constraint Y1 not enforced

Atleast for DB2 when loading data, it does not enforce constraints. Instead you tell it afterwords to:

set integrity for table X IMMEDIATE CHECKED

/Lennart

[...] Received on Sat Nov 06 2004 - 19:47:09 CET

Original text of this message