Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Preferred method in creating primary key

Re: Preferred method in creating primary key

From: John Russell <netnews6_at_johnrussell.mailshell.com>
Date: Fri, 15 Aug 2003 18:36:43 GMT
Message-ID: <i64qjvk14k9fslkbtem5re6crbnbl0ponv@4ax.com>


On Thu, 14 Aug 2003 16:22:46 -0700, Daniel Morgan <damorgan_at_exxesolutions.com> wrote:
>Deferred constraints can not be violated. The only thing that happens when a constraint
>is deferred is that the validity checking waits until the commit.
>
>This can be of great value in loading tables where referential constraints exist and
>where it is time consuming or difficult to track down all of the various relationships
>between parents and children. You can insert all of the records in any order and then
>commit them.
>
>Deferring a primary key or unique constraint is quite a different matter. If it can't
>handle to constraint upon initial insertion ... it never will.

In a data warehousing-type situation, I have loaded data with a null primary key and then filled in the entire column with a single UPDATE statement referencing a sequence. It was much later that I found SQL*Loader could do fill in the values automatically using the SEQUENCE keyword, so the column would never be null.

John

--
Photo gallery: http://www.pbase.com/john_russell/
Received on Fri Aug 15 2003 - 13:36:43 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US