Oracle/PLSQL: SOUNDEX Function
The Oracle/PLSQL SOUNDEX function returns a phonetic representation (the way it sounds) of a string.
SOUNDEX Function Syntax
The syntax for the SOUNDEX function is:
SOUNDEX( string1 )
string1 is the string whose phonetic value will be returned.
The SOUNDEX function algorithm is as follows:
- The SOUNDEX function return value will always begin with the first letter of string1.
- The SOUNDEX function uses only the first 5 consonants to determine the NUMERIC portion of the return value, except if the first letter of string1 is a vowel.
- The SOUNDEX function is not case-sensitive. What this means is that both uppercase and lowercase characters will generate the same SOUNDEX function return value.
The SOUNDEX function can be used in the following versions of Oracle/PLSQL:
- Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i
SOUNDDEX Function Examples
The SOUNDEX function can be used in Oracle/PLSQL. For example:
|SOUNDEX('tech on the net');||would return 'T253'|
|SOUNDEX('TECH ON THE NET');||would return 'T253'|
|SOUNDEX('apples');||would return 'A142'|
|SOUNDEX('apples are great');||would return 'A142'|
|SOUNDEX('applus');||would return 'A142'|