Subject Re: foreign Key Deletion
Author Adam
--- In firebird-support@yahoogroups.com, "Maurizio P." <mauriz_po@...>
wrote:
>
> thanks to everyone , finally i did it :
> just i put a trigger (before update) where i check the value of the
foreign key :
> if it is '"" i change it to null , so i can change the values as i
want .

Now your troubles make a bit more sense.

'' is not the same thing as NULL

NULL references the state of the field, not a value of the field,
whereas '' is a value of the field, not a state. The easiest way to
think about it is that NULL means the value is not known/valid.

So the statement

TCustomer.TBankID := NULL

Means that the customer has no bank

TCustomer.TBankID := ''

Means that the customer has indeed a bank with an ID of ''.

I have never seen a database where you can have a customer not
associated with any organisation, it is a contradiction in terms.
Either they are a customer of an organisation, or they are not a customer.

Perhaps you are using a Customer table instead of a People table?

Adam