Subject Re: [firebird-support] Re: foreign Key Deletion
Author Maurizio P.
... maybe i have confusion :
on delete -> NO ACTION
on update -> NO ACTION

then i try to delete a banks record , and i have exception , and it is what i want
i can insert a customer record without a banks record connectedt and it is ok for me ,
the trouble is that if i try to change a previous inserted customer where i connected
a banks record , and i try to change the connection to null i have an exception .

thanks for answers

Maurizio



----- Original Message -----
From: davidrevill69
To: firebird-support@yahoogroups.com
Sent: Friday, August 18, 2006 1:04 PM
Subject: [firebird-support] Re: foreign Key Deletion


In you original example, the banks record cannot be deleted if a
customer is using it and one cannot be added or updated without a
bank record existing.

However you will have add the constraint 'not null' on IdBank in
customers to prevent a record being posted with a null value

--- In firebird-support@yahoogroups.com, "Maurizio P."
<mauriz_po@...> wrote:
>
> Thanks for Answers
> now i know more about foreign keys ,
> i have a question refering to the two tables of my previous message
(tBanks , tCustomers) :
> i want the user cannot delete a tBanks record if it exists in the
tCustomers table .
>
> No other constraints , e.g. a tCustomer record can be not
connected to any tBanks record .
> ...using foreign keys , i can't leave a tCustomer record without a
tBanks record connected .
>
> can i do that only with triggers ?
>
> thanks
>
> Maurizio
>
> [Non-text portions of this message have been removed]
>






------------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.1/421 - Release Date: 16/08/2006


[Non-text portions of this message have been removed]