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: NOT NULL carried over

Re: NOT NULL carried over

From: Frank Hubeny <fhubeny_at_ntsource.com>
Date: 2000/05/05
Message-ID: <39125AE9.4BE8E40C@ntsource.com>#1/1

After checking a few tables, it appears that the only constraint that gets to the table_copy is a "not null" constraint. The other constraints (primary key, foreign keys, other check constraints) and default values are not carried over.

If this is the case, the reason some fields are nullable in the table_copy that are not null in the original is because these fields are part of the primary key in the original table. Since the primary key is not duplicated in the copy, these fields become nullable in the copy.

Frank Hubeny

Jack Reid wrote:

> Hi.
>
> Can anyone shed any light on why the NOT NULL constraints are sometimes
> carried over into the "table_copy" when I do a:
>
> CREATE TABLE table_copy
> AS SELECT * FROM original_table
>
> and why sometimes they are not? Did a default behavior change recently?
> I'm running Personal Oracle 8i.
>
> Thanks in advance,
>
> Jack Reid
Received on Fri May 05 2000 - 00:00:00 CDT

Original text of this message

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