Home » SQL & PL/SQL » SQL & PL/SQL » which character is entered, when ascii(col1) returns value 160
which character is entered, when ascii(col1) returns value 160 [message #20101] Tue, 30 April 2002 02:30 Go to next message
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.
Re: which character is entered, when ascii(col1) returns value 160 [message #20104 is a reply to message #20101] Tue, 30 April 2002 02:52 Go to previous messageGo to next message
Mosquito
Messages: 6
Registered: April 2002
Junior Member
Hi there,

The ascii character code for the value 160 is "á" (that is, an "a", with the little thingy the french and spanish people use in their language, on top)
Re: which character is entered, when ascii(col1) returns value 160 [message #20107 is a reply to message #20101] Tue, 30 April 2002 03:04 Go to previous messageGo to next message
Shankar. V
Messages: 5
Registered: April 2002
Junior Member
The Ascii value for 160 is space or null. Better check it with Accessories-->Character Map.

select ascii('  ') from dual;
Weird, here's a correction: [message #20108 is a reply to message #20101] Tue, 30 April 2002 03:05 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 #20120 is a reply to message #20107] Tue, 30 April 2002 06:32 Go to previous messageGo to next message
ksr
Messages: 112
Registered: January 2002
Senior Member
Hi,

When i say select ascii(col1) from tab1;

It returns me value 160.

So, if i say select chr(160) from dual; IT shows me blank, so what is the actual value for chr(160),
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 Go to previous message
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 :)
Previous Topic: pl/sql
Next Topic: Re: How to write a generic group function like sum()
Goto Forum:
  


Current Time: Fri Apr 19 16:38:21 CDT 2024