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

Home -> Community -> Mailing Lists -> Oracle-L -> whic one to choose

whic one to choose

From: <MShahid_at_SaudiFrenchBank.com.sa>
Date: Wed, 11 Jul 2001 01:14:19 -0700
Message-ID: <F001.003469B9.20010711012550@fatcity.com>

The definition of char and varchar2 is clear from docu that one is used for fixed length and the other for variable. We are reviewing one database desgin given to use from our developers in that they have chosen to use CHAR(n)
data types at many places, even though the field can have variable lenght data.
For example for a column as region_code it is set as char(5) not this value can be '01' , 'CEN','WEST' etc
would it be wise to make it varhar2(5).
The reason is that if you want to query the colum in a where clause (if you have chosen char(5)) then I think
you have post fix spaces unnecessarily right? (where region_code = '01 '
becuase region_code = '01' would return no rows.

1)
Any ones has any suggestions on how to choose char and varchar2 for columsn that are small in lenght like < 30 characters and unsire of its fixed or variable?

2)
Is there any implication if we convert all those small lenght columsn for which we are not sure of data-lenght from char to varchar2???any side affects in making varch2?

Regards

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author:
  INET: MShahid_at_SaudiFrenchBank.com.sa

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
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 Jul 11 2001 - 03:14:19 CDT

Original text of this message

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