|
|
|
Re: varchar and varchar2 [message #117996 is a reply to message #117961] |
Mon, 02 May 2005 09:10 |
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
|
|
|
|
Re: varchar and varchar2 [message #118155 is a reply to message #118083] |
Tue, 03 May 2005 06:23 |
|
Maaher
Messages: 7065 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
|
|
|