Skip to Main Content
  • Questions
  • Difference between varchar and varchar2

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Shankar .

Asked: January 06, 2009 - 5:11 am UTC

Last updated: July 01, 2017 - 2:50 am UTC

Version: 10.2.0

Viewed 10K+ times! This question is

You Asked

dear tom,
happy new year.
i want to know is there any difference between varchar and varchar2? if no then why oralce having these two identical datatype.
thanks.
regards.
shankar sen

and Tom said...

currently nothing is different.


http://docs.oracle.com/cd/B19306_01/server.102/b14220/datatype.htm#sthref3784

the definition/implementation of varchar might change but varchar2 will not.

This is probably a holdover from when the ANSI SQL standard was still being formulated - there was talk long long ago of possible changes, this would just be a preventative thing.

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Excellent as usual

Shankar sen, January 08, 2009 - 11:18 pm UTC

i have learnt a lot from this site. the most frequently visited site for me.

Mansi, June 30, 2017 - 6:36 pm UTC

Tom,

Somewhere on net I read that,

VARCHAR is reserved by Oracle to support distinction between NULL and empty string in future, as ANSI standard prescribes.

VARCHAR2 does not distinguish between a NULL and empty string, and never will.

Is it true,because I tried this thing on LiveSQL but both gave same result. Both are distinguishing between Null and empty string ?
Connor McDonald
July 01, 2017 - 2:50 am UTC

Currently they are the same.

But VARCHAR *may* one day in future have a different usage pattern than VARCHAR2.

So stick with VARCHAR2