Basic Difference between the three:CHAR(5) is fixed length, right padded with spaces.
VARCHAR(5) is fixed length, right padded with null
VARCHAR2(5) is variable length. (Oracle)
( But, remember CHAR is faster than VARCHAR - some times up to 50% faster. ) Difference between Varchar & Varchar2:(1) Varchar can have MAximum 2000 character while Varchar can contain maximum 4000 character.
(2) Varchar is of ANSI SQL standard. Varchar2 is of Oracle standard.
(3) Varchar2 Datatype: The string value's length will be stored on disk with the value itself.
VARCHAR will occupy space for NULL values VARCHAR2 datatype will not occupy any space.
|