Home » SQL & PL/SQL » SQL & PL/SQL » Difference between varchar and varchar2
Difference between varchar and varchar2 [message #565221] Fri, 31 August 2012 12:33 Go to next message
rubak12
Messages: 1
Registered: August 2012
Location: Chennai
Junior Member
Hi,
What is the exact difference between varchar and varchar2?
As i know only the length is the one difference.Apart from this length,what are all the differences?



Regards,
Rubakumar Krishnamoorthy
Re: Difference between varchar and varchar2 [message #565222 is a reply to message #565221] Fri, 31 August 2012 12:41 Go to previous messageGo to next message
John Watson
Messages: 8977
Registered: January 2010
Location: Global Village
Senior Member
Welcome to the forum. Please read our OraFAQ Forum Guide and How to use [code] tags and make your code easier to read


orcl> create table t(vc varchar(10),vc2 varchar2(10));

Table created.

orcl> desc t;
 Name                          Null?    Type
 ----------------------------- -------- --------------------
 VC                                     VARCHAR2(10)
 VC2                                    VARCHAR2(10)

orcl>
Not a lot of difference!
Re: Difference between varchar and varchar2 [message #565223 is a reply to message #565221] Fri, 31 August 2012 12:43 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
10:42:13 SQL> create table test (ID VARCHAR(8));

Table created.

10:42:38 SQL> DESC TEST
 Name				           Null?	  Type
 ---------------------------------------- -------- ----------------------------
 ID		                                   VARCHAR2(8)


what do you see as the difference?

[Updated on: Fri, 31 August 2012 12:55] by Moderator

Report message to a moderator

Re: Difference between varchar and varchar2 [message #565224 is a reply to message #565221] Fri, 31 August 2012 12:54 Go to previous message
Michel Cadot
Messages: 68757
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Currently there is no difference, they are synonym but in V6 and before there were some differences.
Do NOT use, NEVER VARCHAR always use VARCHAR2 as recommended by Oracle as mabye someday VARCHAR will come back and your application will no more work.

Regards
Michel
Previous Topic: Reference to uninitialized composite
Next Topic: VARRAYS
Goto Forum:
  


Current Time: Thu May 15 13:33:11 CDT 2025