Referential Integrity for TX_CUST_KEYWORD values

I have to assume my discovery is by design.

If I create an entry in "T_KWCODED_VALUES" and specify a value for the "key_value" field, then refer to that value by assigning it to a customer within the "TX_CUST_KEYWORD" table, then change the original value of the "key_value" field in "T_KWCODED_VALUES", then the "key_value" field in "TX_CUST_KEYWORD" is not automatically updated to match the modified value.

I am wondering how this is typically handled?  I am building some custom web code, and I want to join these two tables with the join clause partially conditioned by the "key_value" field.  But if I go into the T_KWCODED_VALUES table and change the value, then the attributes on the customer are not automatically updated, and so my join "breaks".

Is there a better way to do this?

Thanks!

Parents
  • Former Member
    Former Member $organization
    Hi Larry It's certainly correct that that's how it works - the values in T_KWCODED_VALUES are only used to populate the dropdown, and what goes into TX_CUST_KEYWORD is the literal value, rather than a reference back to T_KWCODED_VALUES, so there is no persistent link. But since that is the case, that means that it's fairly safe to update the values in TX_CUST_KEYWORD yourself, if you need to change them, and it would be a simple task to write an update utility that you could run manually whenver you changed a literal value in T_KWCODED_VALUES. ie this sort of thing: Update TX_CUST_KEYWORD set key_value = 'New Value' where keyword_no = my_keyword_no and keyvalue = 'Old Value'
Reply
  • Former Member
    Former Member $organization
    Hi Larry It's certainly correct that that's how it works - the values in T_KWCODED_VALUES are only used to populate the dropdown, and what goes into TX_CUST_KEYWORD is the literal value, rather than a reference back to T_KWCODED_VALUES, so there is no persistent link. But since that is the case, that means that it's fairly safe to update the values in TX_CUST_KEYWORD yourself, if you need to change them, and it would be a simple task to write an update utility that you could run manually whenver you changed a literal value in T_KWCODED_VALUES. ie this sort of thing: Update TX_CUST_KEYWORD set key_value = 'New Value' where keyword_no = my_keyword_no and keyvalue = 'Old Value'
Children
No Data