Oracle/PLSQL: Soundex Function
In Oracle/PLSQL, the soundex function returns a phonetic representation (the way it sounds) of a string.
The syntax for the soundex function is:
soundex( string1 )
string1 is the string whose phonetic value will be returned.
The Soundex algorithm is as follows:
- The soundex 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 return value.
- Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i
|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'|