Results 1 to 8 of 8

Thread: Difference between VARCHAR and VARCHAR2

  1. #1
    Expert Member
    Join Date
    Sep 2005
    Answers
    206

    Difference between VARCHAR and VARCHAR2

    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


  2. #2
    Expert Member
    Join Date
    Dec 2006
    Answers
    204

    Re: Difference between VARCHAR and VARCHAR2

    That topic has been already discussed. Look at:

    Char and Varchar in SQL


  3. #3
    Expert Member
    Join Date
    Sep 2006
    Answers
    477

    Re: Difference between VARCHAR and VARCHAR2

    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!"

  4. #4

    Re: Difference between VARCHAR and VARCHAR2

    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


  5. #5
    Expert Member
    Join Date
    Dec 2006
    Answers
    204

    Re: Difference between VARCHAR and VARCHAR2

    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.


  6. #6
    Junior Member
    Join Date
    Feb 2007
    Answers
    10

    Re: Difference between VARCHAR and VARCHAR2

    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.


  7. #7
    Moderator
    Join Date
    Sep 2006
    Answers
    920

    Re: Difference between VARCHAR and VARCHAR2

    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

  8. #8
    Junior Member
    Join Date
    Feb 2007
    Answers
    17

    Re: Difference between VARCHAR and VARCHAR2

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact