Home » Developer & Programmer » Forms » What is the difference in varchar2 (windows)
What is the difference in varchar2 [message #348842] Thu, 18 September 2008 01:45 Go to next message
Messages: 7
Registered: September 2008
Location: Pune
Junior Member


what is the diference between varchar2(100 char) and varchar2(100).

Re: What is the difference in varchar2 [message #348906 is a reply to message #348842] Thu, 18 September 2008 04:42 Go to previous message
Messages: 21127
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.
Previous Topic: Duplicate Record entry in the FORM BLOCK.
Next Topic: How to import Java through pl/sql
Goto Forum:

Current Time: Sun Jul 23 02:11:34 CDT 2017

Total time taken to generate the page: 0.04212 seconds