This content has been marked as final. Show 5 replies
Pl post details of OS and database versions.
Pl define what you mean by "correct result".
CHR(127) is the 'delete' character (http://www.ascii-code.com/) - how do you plan to "output" or "print" it ?
Pl post (using copy and paste) what you see when you execute your code. What exactly are you trying to achieve ?
There is really no such thing as extended ASCII codes.
Computers use character set encodings to represent text data as bytes. On so-called ASCII platforms, most of these encodings (but not all), represent basic ASCII characters the same way as the ASCII standard does, i.e. as bytes (most precisely: octets) in the range 0-127, and use other possible byte values (128-255) to represent other characters. Depending on the encoding, one or more of these bytes may be used per character. There are encodings (East Asian) where a byte in the ASCII range may actually be a second byte of a multibyte character. Certain encodings, most notably UTF-16, use more than one byte for any character and, therefore, are not a binary superset of ASCII at all. Moreover, the code unit of UTF-16 is not byte (octet) but a 16-bit word ('ub2' in Oracle's C data type naming).
Therefore, please rephrase your question and tell us what you really try to achieve.
And do not post the same question twice in two threads!
In addition to what you have been asked to reveal above, please also provide:
- version of Oracle Client and sql*plus if different from database server home
- details of client environment from which sql*plus is run (even if it runs on the server host)
- database character set. If it is a Utf-8 variant, CHR() might not work as you expect for input values > 127.
os is window xp
version is oracle 10g 10.2.0.1.0
want correct symbol in sql*plus which is given in this sidehttp://www.asciitable.com/ specially for Extended ASCII Codes..
if i use through cmd then its print but in sql*plus its not getting print
Thanx in advance
The mentioned web page uses some very outdated terminology from 1980-ties. The "Extended ASCII Codes", as they call it, are the upper codes of the MS-DOS (aka OEM) code page 437. There are many other OEM code pages available in Windows, where these codes are defined differently. Anyway, if you run SQL*Plus from Command Prompt, do this:
Assuming your database character set supports the particular characters your are interested in, this should help. You can check your database character set by running:
C:\> set NLS_LANG=AMERICAN_AMERICA.US8PC437 C:\> sqlplus ...
What is the result of this query in your database?
SELECT value FROM nls_database_parameters WHERE parameter='NLS_CHARACTERSET';