Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: simple trigger problem ?
Norab,
It is not clear what your table relationship is.... You are saying there is a many-to-one, but what is the key? It can't be customer ID, because then you would have multiple address records... So it must be something like AddressID
Customer, CustID, AddrID .......
AddrID, Address, city, state, zip, etc.....
I wonder what led to this original design...? Are there so many addresses that there is a real big savings normalizing this way? Or is the size small enough that denormalizing the address (into the customer table) would give a big savings in maintenance, coding, etc.???
All of that said... here are some ideas.... (I will assume there is an AddressID field)...
Once you find which condition applies, then you can easily decide what to do:
No matter what, it is not trivial....
Weigh this against changing the design of the address table,
and asking yourself...was there a good purpose in the
beginning for the original design...
(Comments anyone? other suggestions?)
HTH
Robert Proffitt
RTProffitt_at_Beckman.com
"norab" <norab_at_digibel.org> wrote:
> as a project i developed a simple database with oracle designer,
including
> application forms.
> Here is what the problem is:
>
> a table customer is linked to a table adress with a many to one
> relationship.
> when i update a customer's home adress via the form, the adress of
other
> customers who live at the same adress is also changed.
> off course because if 3 customers live at the same adress, only one
adress
> record will be in the adress table. and if one of those three
customers
> change adresses, and i update that record, the two other customers
will also
> have that changed adress.
>
> I was looking for a solution with database triggers (after update on
> adressen), but the problem is that at that point i dont know WHICH
customer
> changed adress.
>
> Is there a solution with database triggers or any other?
> tnx for al help
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon May 08 2000 - 00:00:00 CDT
![]() |
![]() |