which character is entered, when ascii(col1) returns value 160 [message #20101] |
Tue, 30 April 2002 02:30 |
ksr
Messages: 112 Registered: January 2002
|
Senior Member |
|
|
Hi,
i want to know which character or what keyboard key was entered for the value 160.
When i say select ascii(col1) from tab1; it returns me 160.
How to find out what character it is.
I have tried select chr(160) from dual;
it shows me blank.
|
|
|
|
|
Weird, here's a correction: [message #20108 is a reply to message #20101] |
Tue, 30 April 2002 03:05 |
Mosquito
Messages: 6 Registered: April 2002
|
Junior Member |
|
|
On the other hand, selecting ascii('á') returns the value 224, but according to the MSDN Library, "á" is the ascii character 160....
weird.
Well, anyway, according to Oracle, the character 224 is indeed an "invisible" char. If you're using Windows, its the first one on the 5th row of the charcater map in the "Accessories" (an empty space).
|
|
|
Gee, another correction [message #20118 is a reply to message #20108] |
Tue, 30 April 2002 05:36 |
Mosquito
Messages: 6 Registered: April 2002
|
Junior Member |
|
|
I meant "the character 160 is indeed an "invisible" char" in my previous message, of course...
Sorry, I'm overworked, I need a vacation, have mercy on my soul.
|
|
|
|
Re: which character is entered, when ascii(col1) returns value 160 [message #20123 is a reply to message #20101] |
Tue, 30 April 2002 07:25 |
Su
Messages: 154 Registered: April 2002
|
Senior Member |
|
|
In any language/package/OS, the code later to the ascii 127, takes in different form and logically these characters are considered to be non-printable characters. Check the character map also, after 127, the charcter equavelant would not be printed as usual on printer also. When it also comes to ORACLE, the result is same it takes a different form for any ascii code higher than 127. So when you print it using CHR(), it may print different value. Try this out. If you want to enter any special character in ASCII, you could enter it on keyboard using ALT key. For example, by holding ALT key, press 1, 6 and 0 and release it at SQL prompt, it shows 'á' in the output. Check the following, where I entered 160 using ALT+1+6+0, but it returned character equavelant 225.
SQL> select ascii('á') from dual;
ASCII('Á')
----------
225
SQL> select chr(225) from dual;
C
-
á
When you enter ALT+1+6+0 it shows á but it returns 225 in output, and same will be returned when you give CHR(225) only. If you give CHR(160), it returns a blank in the output. All this because of it is higher than 127 which takes in a different form. Hope you got my point.
For clear understanding of these, why and how, you better try to find it out in an ORACLE or a printer reference manual for character mapping.
Good luck :)
|
|
|