Hi,
one question:
two tables: CUSTOMER and ADDRESS, address having a reference to customer.
Is there a way to limit the number of addresses for each customer to lets say, 3 ?
I suggested modelling address1, address2 and address3, but since the number might change this should be avoided.
Check constraints don't allow functions like count().
I was thinking about triggers, an after trigger who would fire when having more than three for this customer and then returning a special return code to the application.
Question: is that possible ? How to return an SQLCode to the application from a trigger ? I did not find a sample and never used it myself before.
Thanks a lot !
one question:
two tables: CUSTOMER and ADDRESS, address having a reference to customer.
Is there a way to limit the number of addresses for each customer to lets say, 3 ?
I suggested modelling address1, address2 and address3, but since the number might change this should be avoided.
Check constraints don't allow functions like count().
I was thinking about triggers, an after trigger who would fire when having more than three for this customer and then returning a special return code to the application.
Question: is that possible ? How to return an SQLCode to the application from a trigger ? I did not find a sample and never used it myself before.
Thanks a lot !