Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VARCHAR2 vs VARCHAR

Posted on 1998-02-05
1
Medium Priority
?
2,899 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 200 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
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…
Via a live example, show how to take different types of Oracle backups using RMAN.

609 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