×
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.
<snip>
It's similar to the folks who use a unique, system-generated number as the actual key for every file. This in theory is freaking awesome, because you can change customer number and every related record will change with it. But it takes a bit more work whenever you're trying to join files together in queries. So often the customer number is attached to a file somewhere and it doesn't get fixed.
</snip>
Which situation are you talking about?
Situation one: CCUST is not the key to RCM (Customer Master). Some hidden uniquely generated column is. The referential constraint between ECH (order header) and RCM would not be CCUST but would be this other key.
Situation two: CCUST remains the key to RCM. However they really start using referential constraints from the database and not just code them in themselves.
Then if someone felt they just had to change the customer number from 12345 to 666 because they didn't like this customer, or if they just wanted to compress all their customer numbers down they could and all would be done automatically.
However situation two would not work since referential constraints cannot be cascaded on updates, just deletes.
create table rob.x14 (
mykey int primary key,
mydesc char(1) not null)
;
create table rob.x15 (
anotherkey int primary key,
mykey int,
somechar char(1),
FOREIGN KEY (mykey) references x14 (mykey)
on update restrict on delete restrict)
;
insert into rob.x14 values(1, 'A');
insert into rob.x15 values(22, 1, 'B');
update rob.x14 set mykey=2 where mykey=1;
-- fails with SQLSTATE 23001, SQL0531 Update prevented by referential constraint
One of the benefits of the hidden field generated key. Although I'm not too fond of people being that concerned about renumbering or otherwise altering primary keys like customer number.
Rob Berendt
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.