Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can I define a Substitution Rule which uses the contents of a different table to determine which rows are updated in the primary table?

0
Posted

Can I define a Substitution Rule which uses the contents of a different table to determine which rows are updated in the primary table?

0

This situation often happens. Take the example of a CUSTOMER table in which you wish to substitute first names based on the contents of the GENDER column held in the CUSTOMER_DETAILS table. The join condition between the tables is the mutual CUSTOMER_ID column. In other words, you want to substitute Female first names in the CUSTOMER table everywhere the equivalent row in the CUSTOMER_DETAILS.GENDER field is ‘F’. This is quite possible to do using only a slightly more complex WHERE Clause. Notice the way the pseudo code of the first part of the WHERE CLAUSE is written (just above the bit you type in). It is written in the form: select from DM_TEST.CUSTOMER DTB1 Well normally you just put WHERE . However, it is quite possible to make a slightly more complex Select referencing the DTB1 alias. Using the WHERE Clause below only the rows from the CUSTOMER table based on an ‘F’ in the CUSTOMER_DETAILS table could be selected (and hence substituted). Note the l

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.