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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: flag

Re: flag

From: Stephane Faroult <sfaroult_at_oriole.com>
Date: Wed, 21 May 2003 13:48:17 -0800
Message-ID: <F001.0059F2F2.20030521134817@fatcity.com>


David Turner wrote:
>
> Would you use a number or char for a flag in a table? Would you use a
> char since it's one byte and a number is 22 bytes?
>
> Dave

Dave,

   A number is *at most* 22 bytes

SQL> select vsize(0), vsize(1), vsize('Y'), vsize('N')   2 from dual;

  VSIZE(0) VSIZE(1) VSIZE('Y') VSIZE('N') ---------- ---------- ---------- ----------

         1 2 1 1

as you can see, the gain is tiny ... especially if NULL values are acceptable.
As a matter of taste, I'd prefer a char(1) but there is no strong rationale behind it, just that I find Y/N more understandable than 1/0. Still a human being :-).

-- 
Regards,

Stephane Faroult
Oriole Software
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Stephane Faroult
  INET: sfaroult_at_oriole.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed May 21 2003 - 16:48:17 CDT

Original text of this message

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