Home » Non-English Forums » French » Code ASCII for Oracle
Code ASCII for Oracle [message #616229] Fri, 13 June 2014 15:13 Go to next message
vantran
Messages: 11
Registered: April 2012
Location: CANADA, MONTREAL
Junior Member
Hi,

I would like to know the code ASCII for the caracter like: '•' for database Oracle (Oracle Form).

Thanks for your answer.

Re: Code ASCII for Oracle [message #616232 is a reply to message #616229] Fri, 13 June 2014 19:25 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9082
Registered: November 2002
Location: California, USA
Senior Member
SCOTT@orcl12c> SELECT ASCII ('•') FROM DUAL
  2  /

ASCII('•')
----------
  14844066

1 row selected.

SCOTT@orcl12c> SELECT CHR (14844066) FROM DUAL
  2  /

CHR
---
•

1 row selected.

Re: Code ASCII for Oracle [message #616417 is a reply to message #616232] Mon, 16 June 2014 13:45 Go to previous messageGo to next message
vantran
Messages: 11
Registered: April 2012
Location: CANADA, MONTREAL
Junior Member
Hi Barbara,

How are you ? Thank you for your answer.

But, when I try to do SELECT CHR(14844066) FROM DUAL, I didn't have the character '•' on Form Oracle,
I had the character '¢' ( symbol one cent)?

Could you help me find the code ASCII exactly the character '•' by the code ASCII form my Form Oracle ?

Thank you so much.

Re: Code ASCII for Oracle [message #616420 is a reply to message #616417] Mon, 16 June 2014 14:45 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
Barbara executed those statements via SQL*Plus(presumably). How are you doing it?

[Updated on: Mon, 16 June 2014 14:47]

Report message to a moderator

Re: Code ASCII for Oracle [message #616424 is a reply to message #616420] Mon, 16 June 2014 15:28 Go to previous messageGo to next message
vantran
Messages: 11
Registered: April 2012
Location: CANADA, MONTREAL
Junior Member
Hi,

I had the character '¢' ( symbol one cent), but not the character '• ??

Thanks.
Re: Code ASCII for Oracle [message #616425 is a reply to message #616424] Mon, 16 June 2014 15:33 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
Can you execute the statements in SQL*Plus, copy paste the session and paste it back here. Just like Barbara demonstrated.

[Updated on: Mon, 16 June 2014 15:35]

Report message to a moderator

Re: Code ASCII for Oracle [message #616434 is a reply to message #616417] Mon, 16 June 2014 18:55 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9082
Registered: November 2002
Location: California, USA
Senior Member
Try copying and pasting the following into a .sql file:

SELECT ASCII ('•') FROM DUAL;


Then, from SQL*Plus, spool to a text file, run the .sql file that you stored the above in, spool off, then edit the text file that you spooled to and see what you get.

You can similarly run something like either of the following on your system to see what various values you get. You may find that you get different results in the SQL*Plus window than when you store the code to a .sql file and spool the results to a text file. I displayed only ASCII values 0 to 127, but you can change the numbers for any range that you want. You can generally find charts on the internet for those values that seem to be consistent everywhere, but the multi-byte characters seem to vary quite a bit. A lot of times there are problems with display between systems. For example, a lot of the codes between 0 and 32 on my system apparently may not display properly on this forum.

-- using SQL:
SCOTT@orcl12c> SELECT ROWNUM - 1 AS ascii,
  2  	    CHR(ROWNUM - 1) AS character
  3  FROM   DUAL
  4  CONNECT BY LEVEL <= 128
  5  /

     ASCII CHAR
---------- ----
         0
         1 
         2 
         3 
         4 
         5 
         6 
         7 
         8 
         9 	
        10
        11 
        12 
        13
        14 
        15 
        16 
        17 
        18 
        19 
        20 
        21 
        22 
        23 
        24 
        25 
        26 
        27 
        28 
        29 
        30 
        31 
        32
        33 !
        34 "
        35 #
        36 $
        37 %
        38 &
        39 '
        40 (
        41 )
        42 *
        43 +
        44 ,
        45 -
        46 .
        47 /
        48 0
        49 1
        50 2
        51 3
        52 4
        53 5
        54 6
        55 7
        56 8
        57 9
        58 :
        59 ;
        60 <
        61 =
        62 >
        63 ?
        64 @
        65 A
        66 B
        67 C
        68 D
        69 E
        70 F
        71 G
        72 H
        73 I
        74 J
        75 K
        76 L
        77 M
        78 N
        79 O
        80 P
        81 Q
        82 R
        83 S
        84 T
        85 U
        86 V
        87 W
        88 X
        89 Y
        90 Z
        91 [
        92 \
        93 ]
        94 ^
        95 _
        96 `
        97 a
        98 b
        99 c
       100 d
       101 e
       102 f
       103 g
       104 h
       105 i
       106 j
       107 k
       108 l
       109 m
       110 n
       111 o
       112 p
       113 q
       114 r
       115 s
       116 t
       117 u
       118 v
       119 w
       120 x
       121 y
       122 z
       123 {
       124 |
       125 }
       126 ~
       127 

128 rows selected.


-- using PL/SQL:
SCOTT@orcl12c> SET SERVEROUTPUT ON FORMAT WRAPPED
SCOTT@orcl12c> BEGIN
  2    DBMS_OUTPUT.PUT_LINE ('	   ASCII CHAR');
  3    DBMS_OUTPUT.PUT_LINE ('---------- ----');
  4    FOR i IN 0..127 LOOP
  5  	 BEGIN
  6  	   DBMS_OUTPUT.PUT_LINE (RPAD (i, 10) || CHR(i));
  7  	 END;
  8    END LOOP;
  9  END;
 10  /
     ASCII CHAR
---------- ----
0
1         
2         
3         
4         
5         
6         
7         
8         
9         	
10        

11        
12        
13        

14        
15        
16        
17        
18        
19        
20        
21        
22        
23        
24        
25        
26        
27        
28        
29        
30        
31        
32
33        !
34        "
35        #
36        $
37        %
38        &
39        '
40        (
41        )
42        *
43        +
44        ,
45        -
46        .
47        /
48        0
49        1
50        2
51        3
52        4
53        5
54        6
55        7
56        8
57        9
58        :
59        ;
60        <
61        =
62        >
63        ?
64        @
65        A
66        B
67        C
68        D
69        E
70        F
71        G
72        H
73        I
74        J
75        K
76        L
77        M
78        N
79        O
80        P
81        Q
82        R
83        S
84        T
85        U
86        V
87        W
88        X
89        Y
90        Z
91        [
92        \
93        ]
94        ^
95        _
96        `
97        a
98        b
99        c
100       d
101       e
102       f
103       g
104       h
105       i
106       j
107       k
108       l
109       m
110       n
111       o
112       p
113       q
114       r
115       s
116       t
117       u
118       v
119       w
120       x
121       y
122       z
123       {
124       |
125       }
126       ~
127       

PL/SQL procedure successfully completed.

Re: Code ASCII for Oracle [message #616498 is a reply to message #616434] Tue, 17 June 2014 10:10 Go to previous messageGo to next message
vantran
Messages: 11
Registered: April 2012
Location: CANADA, MONTREAL
Junior Member
Hi,

When I execute this SQL on PL/SQL Developper: SELECT ASCII ('•') FROM DUAL

I had the code ASCII = 191, but you had the code ASCII = 14844066.
So When I execute the SQL: SELECT CHR (14844066) FROM DUAL, I got the character '¢' (cent)?
Other thing, When I execute the SQL: SELECT CHR (14844066) FROM DUAL, I got the character '¿' ???

I didn'nt unsdestand why ?

Have a nice day. Thank you.
Re: Code ASCII for Oracle [message #616523 is a reply to message #616498] Tue, 17 June 2014 18:18 Go to previous message
Barbara Boehmer
Messages: 9082
Registered: November 2002
Location: California, USA
Senior Member
The first ASCII codes 0-127 are fairly standard on most systems, as far as I know. Beyond that, there seems to be a variety of different codes on different operating systems and databases and tools using various character systems. You may get different results in a SQL*Plus Window, a SQL Developer Window, or when you spool to a text file, depending on various settings within your operating system and database and tool or editor. There may also be some duplication. That is why it is best to copy and paste questionable characters and use the ASCII function if you need to know the numeric value and run a list using CHR if you want to see a list of ASCII values and corresponding characters on your system. When whatever you are using to display the value cannot do so, because of a difference in character sets, then it displays some sort of substitution character, most commonly a question mark.
Previous Topic: Master détails
Next Topic: oracle11XE dans un container Docker sous Windows host
Goto Forum:
  


Current Time: Tue Apr 16 07:21:37 CDT 2024