The string in PL/SQL is actually a sequence of characters with an optional size specification.
The characters could be numeric, letters, blank, special characters or a combination of all.
The ASCIISTR Function in PLSQL is used for converting a string in any character set to an ASCII string using the database character set.
Syntax:
ASCIISTR( string )
Parameters Used:
string – It is used to specify the character set that you want to convert to an ASCII string in the database character set.
Supported Versions of Oracle/PLSQL:
- Oracle 12c
- Oracle 11g
- Oracle 10g
- Oracle 9i
Example:
DECLARE
Test_Char char := 'E';
Test_Char2 varchar2(5) := 'Ê';
Test_Char3 char := 'H';
Test_String varchar2(20) := 'H Ê l l Õ';
BEGIN
dbms_output.put_line(ASCIISTR(Test_Char));
dbms_output.put_line(ASCIISTR(Test_Char2));
dbms_output.put_line(ASCIISTR(Test_Char3));
dbms_output.put_line(ASCIISTR(Test_String));
END;
Output:
E \00CA H H \00CA l l \00D5
Recommended Posts:
- PLSQL | LOG Function
- PLSQL | INSTR Function
- PLSQL | INSTRB Function
- PLSQL | LENGTH2 Function
- PLSQL | SOUNDEX Function
- PLSQL | ASCII Function
- PLSQL | CONCAT Function
- PLSQL | COMPOSE Function
- PLSQL | CHR Function
- PLSQL | CONVERT Function
- PLSQL | DECOMPOSE Function
- PLSQL | DUMP Function
- PLSQL | INITCAP Function
- PLSQL | LENGTHC Function
- PLSQL | LENGTHB Function
- PLSQL | LENGTH4 Function
- PLSQL | LENGTH Function
- PLSQL | LPAD Function
- PLSQL | INSTRC Function
- PLSQL | LTRIM Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

