×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
With a unique constraint across OrderID : ProductID : Quantity ie. Each
product in an order can have different quantity values but no two
records can have the same quantity.
Now before the update the table doesn't break the unique constraint and
if the entire update could complete it would again not break the unique
constraint. The problem is that when Record2 is updated it causes a
duplicate record error (as Record3 in the database as not been updated
yet and contains the same OrderID:ProductID:Quantity at this point). I'm
considering dropping the unqiue constraint at this point as the program
performs the checks on the data before update to ensure no duplicates
exist, but if possible I would like to keep the extra RI the unique
constraint provides.
Setting the primary key to OrderID:ProductID:Quantity is not an option
as each record has a timestamp field which is used to implement
optimistic concurrency, therefore each line has to be able to be
identified by non-changeable values (and good database design usually
indicates that primary key values should be limited to fields who's
values are generally rarely changed)
I would be interested to hear if anyone else has come across this while
using unique constraints?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.