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: VARCHAR2 vs. CHAR

Re: VARCHAR2 vs. CHAR

From: Joseph S. Testa <jtesta_at_scioto.net>
Date: 1997/12/11
Message-ID: <34908258.F1457912@scioto.net>#1/1

johnj_at_dbbasics.com wrote:

> In article <348F49FB.7F7_at_mindspring.com>
> Doogie <jvivona_at_mindspring.com> wrote:
>
> > One of the other things is that VARCHAR2 does not exist in Oracle 6, it
> > was a new type in Oracle 7.
>

NOT TRUE, varchar2 existed in Oracle 6.

> >
> > Watch out for the data conversion. Either export the data, change the
> > columns, truncate the table and re-import the data or you'll need to
> > write a script to trunacte the data in each column (Oracle does not
> > automatically trim the data just becuase you changed the data type - I
> > got burnt the hard way on this)....
> >
>
> I have been burned more than once on the CHAR datatype and it's
> padding of hardcoded spaces to fill up the length. When you query
> you have to include the hard coded spaces or you have to do a
> function to trim off the spaces. In the latter if the function is in your
> where statement, it can not then uses indexes. I hate CHAR so much
> that even if I am creating a a character with a width of 1, like a y or n field,
> I will still use VARCHAR(2).

Note: there is not a difference in oracle between a varchar and a varchar2 but that compatibility may not be around forever, use varchar2 instead.

joe

--
Joseph S. Testa, Oracle Database Administrator, mailto:jtesta_at_scioto.net (home)
Vice-President Ohio Oracle Users Group,
See the Oracle FAQ at http://www.orafaq.org
Try http://web.scioto.net/jtesta that is also the place to find the FREE, drop
column script
ICQ UIN:  2832230(&oracle, home).
Received on Thu Dec 11 1997 - 00:00:00 CST

Original text of this message

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