Returns a value from 0 to 4 representing the difference between the sounds of two strings based on applying the SOUNDEX function to the strings. A value of 4 is the best possible sound match.
The schema is SYSFUN.
The result of the function is INTEGER. The result can be null; if the argument is null, the result is the null value.
VALUES (DIFFERENCE('CONSTRAINT','CONSTANT'),SOUNDEX('CONSTRAINT'),
SOUNDEX('CONSTANT')),
(DIFFERENCE('CONSTRAINT','CONTRITE'),SOUNDEX('CONSTRAINT'),
SOUNDEX('CONTRITE'))
returns the following output:1 2 3
----------- ---- ----
4 C523 C523
2 C523 C536
In the first row, the words have the same result from SOUNDEX while in the second row the words have only some similarity.