SOUNDEX

Click to skip syntax diagram
Read syntax diagramSkip visual syntax diagram>>-SOUNDEX--(--expression--)-----------------------------------><
 

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.

expression
The argument must be an expression that returns a value of any built-in numeric or string data type, other than a CLOB or DBCLOB. The argument cannot be a binary-string. A numeric argument is cast to a character string before evaluating the function. For more information on converting numeric to a character string, see VARCHAR.

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.

Example