// second email address to “@mindspring.com” // or “@earthlink.com”. email2 = NULL len = 0 lenMindspring = strlen(“@mindspring.com) select email2 = C_EMAIL_2 from CUSTOMER where C_ID = c_id len = strlen(email2) if ( ((len lenMindspring) > 0) and – (strcmp(substr(email2,len-lenMindspring, lenMindspring),”@mindspring.com”) == 0) ) { update CUSTOMER set C_EMAIL_2 = substring(C_EMAIL_2, 1, charindex(“@”,C_EMAIL_2) ) + ‘earthlink.com’ where C_ID = c_id } else { /* set to @mindspring.com */ update CUSTOMER set C_EMAIL_2 = substring(C_EMAIL_2, 1, charindex(“@”,C_EMAIL_2) ) + ‘mindspring.com’ where C_ID = c_id } } else if (strcmp(table_name, == 0) { “CUSTOMER_TAXRATE”) // CUSTOMER_TAXRATE // Find the customer’s current country tax rate code. // Calculate cyclically the next tax rate code for the customer’s country. // Update to the new country tax rate code. declare old_tax_rate char(3), new_tax_rate char(3), tax_num int select old_tax_rate = CX_TX_ID from CUSTOMER_TAXRATE where
// second email address to “@mindspring.com” // or “@earthlink.com”. email2 = NULL len = 0 lenMindspring = strlen(“@mindspring.com) select email2 = C_EMAIL_2 from CUSTOMER where C_ID = c_id len = strlen(email2) if ( ((len – lenMindspring) > 0) and (strcmp(substr(email2,len-lenMindspring, lenMindspring),”@mindspring.com”) == 0) ) { update CUSTOMER set C_EMAIL_2 = substring(C_EMAIL_2, 1, charindex(“@”,C_EMAIL_2) ) + ‘earthlink.com’ where C_ID = c_id } else { /* set to @mindspring.com */ update CUSTOMER set C_EMAIL_2 = substring(C_EMAIL_2, 1, charindex(“@”,C_EMAIL_2) ) + ‘mindspring.com’ where C_ID = c_id } } else if (strcmp(table_name, “CUSTOMER_TAXRATE”) == 0) { // CUSTOMER_TAXRATE // Find the customer’s current country tax rate code. // Calculate cyclically the next tax rate code for the customer’s country. // Update to the new country tax rate code. declare old_tax_rate char(3), new_tax_rate char(3), tax_num int select old_tax_rate = CX_TX_ID from CUSTOMER_TAXRATE where
tpcx-v_v2.1.0.docx