Difference between Char/Varchar/Varchar2


Differences between CHAR varchar and varchar2:


CHAR(5) is fixed length, right padded with spaces.
VARCHAR(5) is fixed length, right padded with null
VARCHAR2(5) is variable length.
Thus the difference between VARCHAR and VARCHAR2 is that VARCHAR is ANSI standard but takes up space whereas VARCHAR2 is Oracle-only but makes more efficient use of space.
But as someone has already pointed out, Oracle have resolved this (in 9.2, maybe earlier) by casting VARCHAR to VARCHAR2.

Varchar and Varchar2 both are of variable character. Varchar can have MAximum 2000 character while Varchar can contain maximum 4000 character.
Varchar is of ANSI SQL standart while Varchar2 is of Oracle standard.

Comments

Post a Comment

Popular posts from this blog

How to Get Back Asus Zenphone 5 from Soft Brick

How to configure Glowroot with Liferay

Restore Database from .idb & .frm files in MySQL