oracle-databasesqldatatypes

What is the difference between varchar and varchar2 in Oracle?


What is the difference between varchar and varchar2?


Solution

  • As for now, they are synonyms.

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

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

    If you rely on an empty string and NULL being the same thing, you should use VARCHAR2.