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: Help for Oracle documentation/turning off foreign key constraints

Re: Help for Oracle documentation/turning off foreign key constraints

From: Bob Murphy <murphytx_at_texas.net>
Date: Fri, 24 Dec 2004 05:58:21 -0600
Message-ID: <Su-dnXjUZOCKmVHcRVn-pg@texas.net>


Monty wrote:

> Hi newsgroup, I have not read the Oracle documentation. I need to now
> what to search on to find what I am looking for in the Oracle
> documentation. This is where I need help, what search terms do I use
> to search the Oracle documentation?
>
> Here is my problem. I have a tables with not null foreign key
> constraints to other tables. All new data populated into the tables
> satisfies the foreign key constraints. Some historical data does not.
> Some databases offer the facility to 'turn-off' foreign key
> constraints sometimes. I want to load the old data into the tables
> with the foreign key constraints off. I then want to turn them on for
> all new data. I need to know what 'term' or what this functionality is
> called to search the Oracle documentation for to find out how or if I
> can do this in Oracle. I am using Oracle 9i on Mandrake Pentium 4.
>
> Thank you
>
> Monty

Monty,

Why not make your column nullable with an alter table command and leave the foreign key for referential integrity?

Or, provide a default column value for the historical data?

If you really do not need referential integrity, you could either disable the constraint temporarily (good luck with the subsequent enable) or drop it entirely with an alter table drop constraint command.

Bob. Received on Fri Dec 24 2004 - 05:58:21 CST

Original text of this message

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