Assume that an employee's name is stored as three separate attributes: First Name, Middle Name, and Last Name. The following actions set the value of EMPLOYEE Full Name to Last Name followed by a comma and a space, First Name followed by a space, and the first character of Middle Name followed by a period.
SET employee full_name TO CONCAT(TRIM(employee last_name),
CONCAT(', ',employee first_name))
SET employee full_name TO CONCAT(TRIM(employee full_name),
CONCAT(' ',CONCAT(SUBSTR(employee middle_name,1,1 ),'.')))
If the values of EMPLOYEE First Name, Middle Name and Last Name are Charles, Taze, and Russell, respectively, the value of EMPLOYEE Full Name after the execution of the example statements would be Russell, Charles T.
|
Copyright © 2013 CA.
All rights reserved.
|
|