+ 2

What is the difference between Varchar and Varchar2 data type ?

19th Jul 2016, 8:30 AM
Ashutosh Singh
3 Answers
+ 2
varchar has a memory allocation of 1-2000 bytes. varchar2 has a 'variable' memory allocation of the limit 1-4000 i.e if you insert varchar(20) and enter only 15 characters, 20 bytes will be used in the database whereas in varchar2 if u enter insert varchar2(20) and enter only 15 characters the rest of the five bytes will not be used in the database
19th Jul 2016, 11:01 AM
20th Jul 2016, 5:11 PM
sushant tiwary
sushant tiwary - avatar
I don't agree with stunterx, what you are saying is difference between char and varchar. There is no difference between varchar and varchar2 other then name. The main difference is varchar is ANSI standard and varchar2 is oracle proprietary.
22nd Jul 2016, 5:36 PM
Saurabh Joshi
Saurabh Joshi - avatar