w3resource

Oracle SOUNDEX function

Description

The Oracle SOUNDEX function returns a character string containing the phonetic representation of char. This function lets you compare words that are spelled differently, but sound alike in English.

It helps in tasks like fuzzy matching and phonetic search. This function does not support CLOB data directly. However, CLOBs can be passed in as arguments through implicit data conversion.

Uses of Oracle SOUNDEX Function
  • Phonetic Matching: Compare words that are spelled differently but sound alike.

  • Data Deduplication: Identify and merge records with phonetically similar names.

  • Search Optimization: Enhance search functionality by allowing phonetic searches.

  • Error Tolerance: Improve user input handling by accepting minor spelling variations.

Syntax:

SOUNDEX(char)

Parameters:

Name Description Data Types
char A string whose SOUNDEX string is to be retrieved. CHAR, VARCHAR2, NCHAR, or NVARCHAR2

Return Value Type

CHAR, VARCHAR2, NCHAR, or NVARCHAR2

Applies to

Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i

Examples: Oracle SOUNDEX function

The following example returns the employees whose last names are a phonetic representation of "Smyth":

SELECT last_name, first_name
FROM employees 
WHERE SOUNDEX(last_name) = SOUNDEX('SMYTHE') ORDER BY last_name, first_name;
 

Sample Output:

LAST_NAME  FIRST_NAME
---------- ----------
Smith      Lindsey
Smith      William

Previous: RTRIM
Next: SUBSTR



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/oracle/character-functions/oracle-soundex-function.php