What is difference between varchar and varchar2 ?

Total Post:31

Points:155
 257  View(s)
Ratings:
Rate this:
  1. Post:31

    Points:155
    What is difference between varchar and varchar2 ?

    A Brief Comparison between varchar and varchar2

    1) The varchar can store minimum 1 and maximum 2000 bytes of character data. 1) The varchar2 can store minimum 1 and maximum 4000 bytes of character data.
    2) The varchar can identify NULL and empty string separately. 2) The varchar2 cannot identify both separately. Both considered as same for this.

    3) Allocate fixed size of data irrespective of the input.


    Ex: We defined varchar (15) and entered only 10 characters. But it allocates space for entire 15 characters.

    3) Allocate the variable size of data based on input.


    Ex: We defined varchar2 (15) and entered only 10 characters. Then varchar2 will allocate space for 10 characters only but not for 15.

    4) For varchar data, extra spaces are padded to the right side. 4) For varchar2 extra spaces will be truncated.
    5) The varchar is ANSI SQL standard 5) The varchar2 is Oracle standard
    6) The varchar definition may change in the future. 6) The varchar2 definition will not change. It is standard.
    7) The varchar is an external datatype. 7) The varchar2 is an internal datatype.



Answer