Solved

VARCHAR2 vs VARCHAR

Posted on 1998-02-05
1
2,889 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

705 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