|
Re: What is the difference in varchar2 [message #348906 is a reply to message #348842] |
Thu, 18 September 2008 04:42 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Once upon a time, "character" datatype columns were defined by number of bytes we wanted to store into them. This was just fine until multi-byte character sets came into plot, so number-of-characters became different from number-of-bytes.
Recent Oracle versions (the first one was 9i, I believe) introduced a different approach, so you could declare columns as VARCHAR2(100), VARCHAR2(100 BYTE) and VARCHAR2(100 CHAR).
VARCHAR2(100) uses the default length semantics which is defined by the NLS_LENGTH_SEMANTICS (by default, its value is set to BYTE).
VARCHAR2(100 BYTE) declares a column which is to store 100 bytes, regardless of number of character it represents.
VARCHAR2(100 CHAR) does the same, just vice versa.
|
|
|