Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> storing a one byte number ( 0..255 )

storing a one byte number ( 0..255 )

From: Dmitry N. Budanov <dima_at_martelcom.ru>
Date: 1 Apr 2004 05:01:58 -0800
Message-ID: <249dbe14.0404010501.43f0529b@posting.google.com>


hi all.

query:

 create table test ( a smallint, b raw(1) )

 insert into test values ( 1, hextoraw('1') )
 insert into test values ( 255, hextoraw('ff') )
 select rawtohex(a), dump(a, 16), a, rawtohex(b), dump(b, 16), b from test

result:

 RAWTOHEX(A) DUMP(A,16) A RAWTOHEX(B) DUMP(B,16) B

am i _compact_ store number with a small value? 3 bytes for number in 0 ... 255 range is a very expensive :(

WBR, Dmitry Received on Thu Apr 01 2004 - 07:01:58 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US