Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Data Warehouse and Constraints
In article <882370395.2082996227_at_dejanews.com> , shawe_at_indy.tce.com writes:
>Due to the fact that if we turn on the foreign key constraints and there
>is not an entry in the parent table the job would fail thus holding up
>our schedule, It has been suggested that we should run a SQL script that
>checks for integrity violations and if there is a row missing in a parent
>table that row would be added with a default value.
Why don't you use:
ALTER TABLE BLAH ENABLE CONSTRAINT FOO EXCEPTIONS INTO BAR; That way, the bad rows are written to BAR, and the statement doesn't fail.