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: Picking CHAR over VARCHAR2

RE: Picking CHAR over VARCHAR2

From: Rodgers, Tony (CEI-Atlanta) <Tony.Rodgers_at_cox.com>
Date: Wed, 24 Feb 1999 11:16:49 -0500
Message-ID: <529B47EE34C4D1118D0800A0C99ABC984BCCE4@EATL0S04>


Sometimes it makes sense to put certain kinds of data in a char column. For example, a state abbreviation which is always two characters. Straight out of the Oracle Application Developer's Guide is this advice concerning varchar2 vs. char:
Oracle uses different semantics to compare values of each datatype. You might choose one datatype over the other if your application is sensitive to the differences between these semantics. For example, if you want Oracle to ignore trailing blanks when comparing character values, you must store these values in CHAR columns.

So, note that for CHAR columns, Oracle will IGNORE trailing blanks in comparisons.

> -----Original Message-----
> From: Doug Cowles [SMTP:dcowles_at_bigfoot.com]
> Posted At: Wednesday, February 24, 1999 10:27 AM
> Posted To: comp.databases.oracle.server
> Conversation: Picking CHAR over VARCHAR2
> Subject: Picking CHAR over VARCHAR2
>
> Char has padded space, making string matches more difficult. So why
> would I pick
> a Char over a VARCHAR2 even if it was only one character?
Received on Wed Feb 24 1999 - 10:16:49 CST

Original text of this message

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