Name

ASCIISTR

Synopsis

The ASCIISTR function takes a string in any character set and converts it into a string of ASCII characters. Any non-ASCII characters are represented using the form \XXXX, where XXXX represents the Unicode value for the character. The specification for ASCIISTR is:

FUNCTION ASCIISTR (string1 IN VARCHAR2) RETURN VARCHAR2;

Following is an example of ASCIISTR in use:

BEGIN 
   DBMS_OUTPUT.PUT_LINE(
      ASCIISTR('The letter ã is not an ASCII character.')
   );
END;

The output is:

The letter \00E3 is not an ASCII character.

The UNISTR function, described later in this chapter, is the inverse of ASCIISTR.

Tip

For information on Unicode, including the underlying bytecodes used to represent characters in the Unicode character set, visit http://unicode.org.

Get Oracle PL/SQL Programming, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.