Oracle 19c SQL

  1. Home
  2. Docs
  3. Oracle 19c SQL
  4. 3 Oracle Functions
  5. Character Functions: CHR, ASCII, SOUNDEX

Character Functions: CHR, ASCII, SOUNDEX

CHR function in Oracle

CHR function takes a NUMBER as argument and returns a character.

SELECT CHR(68)||CHR(67)||CHR(84)||CHR(68)||CHR(69) Name
  FROM DUAL;

ASCII function in Oracle

The Oracle ASCII function returns the NUMBER that represents the specified character.

The specified character to retrieve the NUMBER code for. If more than one character is entered, the ASCII function will return the value for the first character and ignore all of the characters after the first.

SELECT ASCII('d') FROM DUAL;
SELECT ASCII('D') FROM DUAL;
SELECT ASCII('dcodeman') FROM DUAL;


SOUNDEX function in Oracle

The Oracle SOUNDEX function returns a phonetic representation (the way it sounds) of a string.

The SOUNDEX function is not case-sensitive. This means is that both uppercase and lowercase characters will generate the same SOUNDEX function return value.

SELECT SOUNDEX('dcodeman') FROM DUAL;

SELECT SOUNDEX('DCODEMAN')  FROM DUAL;

SELECT SOUNDEX('decodeman')  FROM DUAL;

SELECT SOUNDEX('DECODEMAN')  FROM DUAL;

SELECT SOUNDEX('decode')  FROM DUAL;

SELECT SOUNDEX('DECODE')  FROM DUAL;

Was this article helpful to you? Yes No

How can we help?