The SOUNDEX function returns a 4 character code representing the sound of the words in the argument. The result can be used to compare with the sound of other strings.
The data type of the result is CHAR(4). If the argument can be null, the result can be null; if the argument is null, the result is the null value.
The CCSID of the result is the default CCSID of the current server.
The SOUNDEX function is useful for finding strings for which the sound is known but the precise spelling is not. It makes assumptions about the way that letters and combinations of letters sound that can help to search out words with similar sounds. The comparison can be done directly or by passing the strings as arguments to the DIFFERENCE function. For more information, see DIFFERENCE.
SELECT EMPNO, LASTNAME FROM EMPLOYEE WHERE SOUNDEX(LASTNAME) = SOUNDEX('Loucesy')Returns the row:
000110 LUCCHESSI
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.