Oracle PL/SQL/Char Functions/ASCII

Материал из SQL эксперт
Перейти к: навигация, поиск

ASCII("A") ASCII("Z") ASCII("A") ASCII("Z") ASCII("ABC")

 
SQL>
SQL>
SQL> select ascii("a"), ascii("z")
  2  ,      ascii("A"), ascii("Z")
  3  ,      ascii("ABC"), chr(77)
  4  from   dual;
ASCII("A") ASCII("Z") ASCII("A") ASCII("Z") ASCII("ABC") C
---------- ---------- ---------- ---------- ------------ -
        97        122         65         90           65 M
SQL>



Ascii: Gives the ASCII value of the first character of a string

 

SQL>
SQL>
SQL> --Ascii: Gives the ASCII value of the first character of a string.
SQL>
SQL> SELECT ASCII("first") FROM dual;
ASCII("FIRST")
--------------
           102



ASCII() returns the numeric value of the leftmost character of the string.

  
SQL>
Syntax: ASCII(<expression>)
SQL>
SQL>
SQL> SELECT
  2     ASCII("A")   uppercase_a,
  3     ASCII("abc") lowercase_a from dual;
UPPERCASE_A LOWERCASE_A
----------- -----------
      65.00       97.00
SQL>
SQL>