Re: In what type in Oracle it is possible to write down binary <8bit?

From: Malcolm Dew-Jones <yf110_at_vtn1.victoria.tc.ca>
Date: 7 Oct 2008 16:59:20 -0800
Message-ID: <48ebf7d8$1@news.victoria.tc.ca>


Ed Prochak (edprochak_at_gmail.com) wrote:
: On Oct 3, 5:47=A0am, "gym dot scuba dot kennedy at gmail"
: <kenned..._at_verizon.net> wrote:
: > <mmf.stave..._at_gmail.com> wrote in message
: >
: > news:e0ff1b3e-4f77-41dd-b628-4123954f2b47_at_s50g2000hsb.googlegroups.com...=
: > Hello,
: >
: > > In what type in Oracle it is possible to write down binary <8bit?
: >
: > > Thanks,
: >
: > > St. Mr
: >
: > That would be a raw column or a blob column depending upon size.
: > Jim

: Actually nothing stops you from inserting nonprintable ascii
: characters in a VARCHAR2 column.
: [Speaking from the experience of an ASCII nul (0) inserted in VARCHAR2
: by a C program.]

: I have a table badlog with column
: last_line VARCHAR2(100);

: insert into badlog values ('eee'||chr(1)||chr(5)||'ddd') ;

: SELECT * from badlog;

: LAST_LINE
: --------------------
: eee<01><05>ddd --- modified to not post binary 01 and 05 in case
: that

: 1 row selected.

: select rawtohex(last_line) from badlog ;
: RAWTOHEX(LAST_LINE)
: --------------------------------
: 6565650105646464 --- you can see they are real binary values.

: 1 row selected.

: I would not recomend this, but it works. Displaying the result will
: depend heavily on your character set.
: Ed

I wonder what happens if you insert a chr() into a utf-8 character string. I have no way to test this.

E.g. if the database uses utf-8 and s is a varchar column

	insert into mytbl (s) values (chr(244)); 
	select rawtohex(s) from mytbl; 

will that show one byte, value F4, or multiple bytes ( 0xbf 0xc2 I believe).

??? Received on Tue Oct 07 2008 - 19:59:20 CDT

Original text of this message