Hello,
I am working on a small database design... could some one explain me the specific reason when to use VARCHAR, VARCHAR2 and CHAR.
Thanks,
Suji
Hello,
I am working on a small database design... could some one explain me the specific reason when to use VARCHAR, VARCHAR2 and CHAR.
Thanks,
Suji
That topic has been already discussed. Look at:
Char and Varchar in SQL
Thanks for doing my Job Barbie. If interesetd you can also lend some hand in moderating stuff
-Kalayama
[COLOR="Blue"][SIZE="2"]"If you are not living on the edge of your life, you are wasting space"[/SIZE][/COLOR]
Someone says "Impossible is nothing". The man next him says "Let me see you licking your elbow tip!"
When u r designing a database u have ideas about the data entry in tht database table if ur value of fild is fixed length then it is better to use vachar but it having vatition in ur value then it is better to use varchar2 because of this u can save ur database size and in future it is better 4 performance tunning os database...
Regards..
Vishal
Hi vishal,
Both varchar and varchar2 are for variable length strings only. we can use char for fixed length strings.
The only difference is the maximum length it allows. See the link in my previous post.
Hi,
-->Varchar and Varchar2 ,both r used to support variable length character strings.
-->Varchar takes a max size of 2000 characters where as it is 4000 with varchar2
-->Varchar occupies space for null values,Varchar2 does not occupy space for null values
-->In further versions Varchar can be replaced by varchar2 ,so better use varchar2
Regards,
Radhi.
The difference between Varchar and Varchar2 is both are variable length but only 2000 bytes of character of data can be store in varchar where as 4000 bytes of character of data can be store in varchar2.
Use char for fixed size data.
Regards,
Brijesh Jain
---------------------------------------------------------
Connect with me on Skype: jainbrijesh
Google Plus : jainbrijeshji
This is with reference to Oracle
VARCHAR
Currently VARCHAR behaves exactly the same as VARCHAR2. However, this type should not be used as it is reserved for future usage.
VARCHAR2 is used to store variable length character strings. The string value's length will be stored on disk with the value itself.