Newsgroups: comp.databases.oracle.server
Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.glorb.com!sws1!ornl!news.er.usgs.gov!news
From: Brian Peasland <dba@nospam.peasland.net>
Subject: Re: Integrity constraint violated
In-Reply-To: <1155036819.687564.143660@i42g2000cwa.googlegroups.com>
X-Nntp-Posting-Host: edc-cv-160-54.cr.usgs.gov
Content-Type: text/plain; charset=ISO-8859-2; format=flowed
Message-ID: <J3oHqo.53E@igsrsparc2.er.usgs.gov>
User-Agent: Thunderbird 1.5.0.5 (Windows/20060719)
Sender: news@igsrsparc2.er.usgs.gov (Janet Walz (GD) x6739)
Content-Transfer-Encoding: 7bit
Organization: U.S. Geological Survey, Reston VA
References: <1155031051.370417.300980@i42g2000cwa.googlegroups.com>   <1155035976.755739.76650@h48g2000cwc.googlegroups.com> <1155036819.687564.143660@i42g2000cwa.googlegroups.com>
Mime-Version: 1.0
Date: Tue, 8 Aug 2006 12:08:43 GMT
Lines: 41
Xref: dp-news.maxwell.syr.edu comp.databases.oracle.server:272358

mamin@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?
> 

Oracle has not generated this constraint for you...this constraint was 
created when the database schema was designed. The designer of the 
schema has determined that this business rule must be followed and coded 
that rule in the form of the constraint. You will have to talk with the 
database designer to determine why their constraint exists. This may 
mean talking with your application's vendor.


HTH,
Brian

-- 
===================================================================

Brian Peasland
dba@nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown
