Home » Other » General » varchar and varchar2
varchar and varchar2 [message #76150] Sun, 05 December 2004 01:03 Go to next message
rajesh
Messages: 173
Registered: November 1998
Senior Member
Is there difference bbetweená varchhar and varchar2
Re: varchar and varchar2 [message #76151 is a reply to message #76150] Mon, 06 December 2004 10:53 Go to previous messageGo to next message
Just John
Messages: 69
Registered: November 2004
Member
Nothing!!! (apart from the name - obviously)

Oracle recommend the use of VARCHAR2.
icon14.gif  Re: varchar and varchar2 [message #117961 is a reply to message #76150] Mon, 02 May 2005 03:08 Go to previous messageGo to next message
ipiyush
Messages: 2
Registered: May 2005
Location: Bangalore
Junior Member
The difference between Varchar and Varchar2 is that, both are variable length but only 2000 bytes of character of data can be stored in varchar where as 4000 bytes of character of data can be stored in varchar2.
Re: varchar and varchar2 [message #117996 is a reply to message #117961] Mon, 02 May 2005 09:10 Go to previous messageGo to next message
naga_faq
Messages: 17
Registered: April 2005
Location: Pondy
Junior Member
varchar2 and varchar having some light difference.

varchar(10) - it occupies 10 characters, if it is 5 or 6 or any thing, but less than 10.

varchar2(10) - it deponds on the characters. If it is 5 means, it occupy only five bytes. Remaining memory we can use other variable.

I may thing this is differences.

[Updated on: Mon, 02 May 2005 09:11]

Report message to a moderator

icon4.gif  Re: varchar and varchar2 [message #118083 is a reply to message #117996] Mon, 02 May 2005 23:58 Go to previous messageGo to next message
ipiyush
Messages: 2
Registered: May 2005
Location: Bangalore
Junior Member
the difference u r telling is between char and varchar..
varchar in itself means variable characters.
Re: varchar and varchar2 [message #118155 is a reply to message #118083] Tue, 03 May 2005 06:23 Go to previous message
Maaher
Messages: 7064
Registered: December 2001
Senior Member
Or you could look in the manuals:

http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10759/sql_elements001.htm#sthref51

Oracle® Database SQL Reference 10g Release 1 (10.1)Part Number B10759-01 says

CHAR Datatype

The CHAR datatype specifies a fixed-length character string. Oracle ensures that all values stored in a CHAR column have the length specified by size. If you insert a value that is shorter than the column length, then Oracle blank-pads the value to column length. If you try to insert a value that is too long for the column, then Oracle returns an error.
....
....
VARCHAR2 Datatype

The VARCHAR2 datatype specifies a variable-length character string. When you create a VARCHAR2 column, you supply the maximum number of bytes or characters of data that it can hold. Oracle subsequently stores each value in the column exactly as you specify it, provided the value does not exceed the column's maximum length of the column. If you try to insert a value that exceeds the specified length, then Oracle returns an error.
....
....
VARCHAR Datatype

The VARCHAR datatype is currently synonymous with the VARCHAR2 datatype. Oracle recommends that you use VARCHAR2 rather than VARCHAR. In future releases, VARCHAR might be defined as a separate datatype used for variable-length character strings compared with different comparison semantics.


First prize goes to Just John!

[EDIT: Moved to General, as there was no reference to Oracle Text whatsoever]
MHE

[Updated on: Tue, 03 May 2005 06:25]

Report message to a moderator

Previous Topic: oracle with access
Next Topic: Free Oracle Manager?
Goto Forum:
  


Current Time: Sat Jun 10 19:19:37 CDT 2023