1

I am not understanding why CHR(157) is used code of ORACLE. When I executed below code i got output as 'HELLO WORLD!'

SELECT 'HELLO' || CHR(157) || ' WORLD!' FROM DUAL;

Some of editors don't display the CHR(157) value. Please let me know if anybody knows why CHR(157) is used in oracle.

Devashri B.
  • 2,593
  • 8
  • 25
  • 39
  • 1
    Presumably, when you say "used in Oracle" you mean that you have some application that uses `chr(157)` in some query. What character that produces will depend on the database character set. You'd need to tell us what character set to interpret 157 in to know what character that is supposed to represent. It wouldn't be valid in Unicode, US7ASCII, or Windows-1252 for example. – Justin Cave Mar 09 '16 at 23:37

1 Answers1

1

The glyph which is displayed for CHR(157) depends on the font you're using. For example, if you're using an "IBM PC Extended ASCII" font, you'll get something that looks like a Y with an = superimposed over the top of it (see the glyph at 9D (the hexadecimal equivalent of 157) below):

enter image description here

If you're using some other font, you'll get something else - or nothing at all, if the font doesn't define a glyph for that character - for example, the "Microsoft Windows" character set doesn't define a glyph for 157 (hex 9D):

enter image description here

Best of luck.