Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Master detail tables with foreign key defined on detail table.
Tue, Oct 30 2012 12:11 PMPermanent Link

Vitor Martins

Pregitzer & Ca., Lda


The constraint check works fine for detail table, i can't insert records if violates the constraint.
In the master table i can insert or delele records without restriction (even if the records violate the constraint).

The constraint "foreign key" only work for slave table?

Tanks
Vitor Martins
Tue, Oct 30 2012 1:27 PMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Vitor,

No, the constraint should be enforced for both tables.
However I'm not sure about what you are seeing... would you mind to post the table definitions please ?

--
Fernando Dias
[Team Elevate]
Tue, Oct 30 2012 2:00 PMPermanent Link

Raul

Team Elevate Team Elevate

Virot,

In relation to master and detail table there can be no "foreign
constraint" on the master table relative to the detail table.

Master table can have other constraints including foreign key
constraints to some other table and it should honor those.

Raul


On 10/30/2012 12:11 PM, Vitor Martins wrote:
> The constraint check works fine for detail table, i can't insert records if violates the constraint.
> In the master table i can insert or delele records without restriction (even if the records violate the constraint).
>
> The constraint "foreign key" only work for slave table?
>
> Tanks
> Vitor Martins
>
Tue, Oct 30 2012 2:01 PMPermanent Link

Raul

Team Elevate Team Elevate

Sorry - meant Vitor.

On 10/30/2012 2:00 PM, Raul wrote:
> Virot,
>
> In relation to master and detail table there can be no "foreign
> constraint" on the master table relative to the detail table.
>
> Master table can have other constraints including foreign key
> constraints to some other table and it should honor those.
>
> Raul
>
>
> On 10/30/2012 12:11 PM, Vitor Martins wrote:
>> The constraint check works fine for detail table, i can't insert
>> records if violates the constraint.
>> In the master table i can insert or delele records without restriction
>> (even if the records violate the constraint).
>>
>> The constraint "foreign key" only work for slave table?
>>
>> Tanks
>> Vitor Martins
>>
>
Tue, Oct 30 2012 2:34 PMPermanent Link

Vitor Martins

Pregitzer & Ca., Lda

Fernando Dias wrote:

Vitor,

No, the constraint should be enforced for both tables.
However I'm not sure about what you are seeing... would you mind to post the table definitions please ?

--
Fernando Dias
[Team Elevate]

Dear Fernando Dias (Portuguese Name?)

After drop and recreate the foreign key constraint everything is working fine.

Thanks to all.
Tue, Oct 30 2012 5:48 PMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Vitor,

Yes, Portuguese name Smiley

--
Fernando Dias
[Team Elevate]

Em 30-10-2012 18:34, Vitor Martins escreveu:
> Fernando Dias wrote:
>
> Vitor,
>
> No, the constraint should be enforced for both tables.
> However I'm not sure about what you are seeing... would you mind to post the table definitions please ?
>
> --
> Fernando Dias
> [Team Elevate]
>
> Dear Fernando Dias (Portuguese Name?)
>
> After drop and recreate the foreign key constraint everything is working fine.
>
> Thanks to all.
>
Image