Solved

VARCHAR2 vs VARCHAR

Posted on 1998-02-05
1
2,886 Views
Last Modified: 2008-02-26
I've been told VARCHAR is being phased out, and fields should be VARCHAR2. In passing this recommendation along in design standards, I need more information on the reasons for changing from VARCHAR to VARCHAR2.
0
Comment
Question by:micz
1 Comment
 
LVL 2

Accepted Solution

by:
frankr earned 50 total points
ID: 1082111
VARCHAR is an ANSI-SQL mandated datatype.  As such, it's subject to change by ANSI (whether Oracle likes it or not).

There was some question when this type was defined whether there were more changes in the offing.  Oracle did not want to be caught in the situation they'd just gone through, where they already had a datatype established that conflicted with a newer ANSI definition (Oracles pre-ANSI CHAR datatype was variable length, and the standard made it fixed length.  The ANSI VARCHAR type was the equivalent of the original Oracle CHAR.)

In order to be ANSI compatible, Oracle had to redefine CHAR, and all of the apps built on Oracle had to redefine CHAR to VARCHAR (or VARCHAR2). This was implemented during the Oracle6 to Oracle7 release.  VARCHAR2 was defined by Oracle and recommended as preferable to VARCHAR because it was extremely unlikely that ANSI would create a VARCHAR2 datatype, and Oracle could continue to support whatever definition they use, even if the ANSI definition of VARCHAR changed.

Currently the two datatypes are identical, and you're free to use either.  However, if you use VARCHAR and the ANSI standard changes, Oracle will be forced to change the VARCHAR type to conform, and you'll have to change any apps that depend on it.
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question