| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Integrity constraint violated
mamin_at_o2.pl wrote:
> > Please read the error message *carefully* and try to understand it.
> > It tells you for the ZAMOWIENIA_POZYCJE record with stawka_vat_id 1,
> > there is no corresponding FAKTURY_VAT record, with ID 1.
> > Unless your constraints are deferred (so they are checked at commit),
> > the FAKTURY_VAT parent record needs to be present and committed prior
> > to inserting any ZAMOWIENIA_POZYCJE record with STAWKA_VAT_ID 1.
> >
>
>
> Thanks,
> I think You are right. But if so , this constraint is incorrect because
> in fact ZAMOWIENIA_POZYCJE table has column FAKTURA_VAT_ID, where
> foreign key from FAKTURY_VAT is being stored.While STAWKA_VAT_ID column
> keeps foreign key from STAWKI_VAT table.
> So, is it possible that Oracle has generated incorrect constraint?
Not very likely.
Oracle doesn't generate constraints automatically.
If it did generate constraints, it is because you or someone else, is
using Designer, and instructed it do to so.
It looks like either you or someone else has made a design error, and
you need to rectify this. Drop the foreign key (alter table drop
constraint) and set up the correct one.
-- Sybrand Bakker Senior Oracle DBAReceived on Tue Aug 08 2006 - 06:55:27 CDT
![]() |
![]() |