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: varchar vs varchar2

Re: varchar vs varchar2

From: Hans Forbrich <forbrich_at_telusplanet.net>
Date: Tue, 05 Aug 2003 01:14:12 GMT
Message-ID: <3F2F02D4.83821FEB@telusplanet.net>


Jack wrote:

> <Quotes from documentation>
> The VARCHAR datatype is synonymous with the VARCHAR2 datatype. To avoid
> possible changes in behavior, always use the VARCHAR2 datatype to store
> variable-length character strings.
>
> </Quotes>
>
> I wonder what "possible changes in behavior" could be?
>
> Thanks.

Buried in the old documentation it states that the varchar and varchar2 could differ in trailing-blank/null comparison semantics in the future. For now 'varchar' seems to be converted consistently to 'varchar2', but at some future date comparing (varchar 'XYZ' to char 'XYZ ') might work differently from (varchar2 'XYZ' to char 'XYZ ')

For a fascinating look at the evolution (and the justification for not having thrown out my old manuals):

From my Oracle 5.1 Database Administrator's Guide

From my Oracle 6.0 Database Administrator's Guide

From my Oracle 7.0 Concepts Guide

and

"ANSI SQL Datatype: CHARACTER VARYING(n), CHAR VARYING(n) correspond to Oracle datatype VARCHAR(n)"

whereas

"DB2 or SQL/DS Datatype: VARCHAR (n) correspond to Oracle Datatype: VARCHAR2 (n)" Received on Mon Aug 04 2003 - 20:14:12 CDT

Original text of this message

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