Subject | Re: [firebird-support] Re: get foreign key |
---|---|
Author | ian |
Post date | 2007-04-10T21:38:45Z |
Hi,
Please do not take this the wrong way, but I think you need to do some
more thinking, before you do any more coding.
Rick Debay wrote:
customer then changes the currency, this will only affect future
transactions, not previous ones. Whether or not you allow customers to
change currency is a business decision, not a technical one.
data.
substituting your actual table/field names:
IF EXISTS (SELECT 1 FROM sales WHERE customer = id)
regards
ian
Please do not take this the wrong way, but I think you need to do some
more thinking, before you do any more coding.
Rick Debay wrote:
>A completed transaction happened with a particular currency id. If the
>
> > if the user change the currency_id in the customer record then i have
> to change all the currency_id in sales order which reference to this
> customer
>
customer then changes the currency, this will only affect future
transactions, not previous ones. Whether or not you allow customers to
change currency is a business decision, not a technical one.
> Cascading update on the foreign key.This would change the details of completed transactions, to give invalid
data.
>Only if you choose to restrict them to the first currency used.
> > i have to prevent the user from changing the currency id ones its been
> used in sales order
>Test for records in the child table with something like this,
>
> You're right. Deleting a record is a bad idea. however, i do need to
> know whether the current customer record have active foreign key
> references.
substituting your actual table/field names:
IF EXISTS (SELECT 1 FROM sales WHERE customer = id)
regards
ian