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

Home -> Community -> Usenet -> c.d.o.server -> Re: char vs. varchar

Re: char vs. varchar

From: Kevin S Hoffman <{khoff_at_plaza.ds.adp.com}>
Date: Wed, 6 Jan 1999 09:57:15 -0800
Message-ID: <7708ca$dlt@myst.plaza.ds.adp.com>


to the best of my knowledge, the difference between storage of char and varchar is that if you have a field that is a char(20), then if you store 1 character in it, Oracle will store 19 spaces after that... Essentially giving you a fixed-length field. If you use a varchar(20), and store 1 character, Oracle only maintains the 1 character, and an internal indicator as to the size of the 'actual' data in the varchar field.

Unless you know that every record is going to have a fixed-length, same-size field, and you're not just storing single-character data (like 'Y' or 'N'),
then I'd recommend sticking with varchar2. Received on Wed Jan 06 1999 - 11:57:15 CST

Original text of this message

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