Results 1 to 5 of 5

Thread: Varchar2

  1. #1
    Join Date
    Jan 2004
    Location
    Singapore
    Posts
    89

    Exclamation Unanswered: Varchar2

    This is a basic question. But i get confused because i do not know actually what happens when a table get created.

    "If 5 characters are stored in Varchar2(50), only 5 bytes will be used."
    Making use of this facility, can I blindly use varchar2 datatype as varchar2(1000) as it will not waste the storage space? Will it do any kind of internal allocation at database level whenever it finds datatype of 1000 length?
    Thanks and Regards,

    Praveen Pulikunnu

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    Yes, you could do that and not waste space. However, you would of course lose the rule that prevents a user from entering more than x characters in a particular column. Also, some client programs will see the varchar2(1000) definition and will automatically allow 1000 characters of memory for each column. Better to continue to put sensible limits on the column sizes!

  3. #3
    Join Date
    Jan 2004
    Location
    Singapore
    Posts
    89

    Smile

    Thanks Andrewst
    Thanks and Regards,

    Praveen Pulikunnu

  4. #4
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    I believe that you will also incur the added expense of an additional byte
    per row per column over 250 bytes ..... This is part of Oracle's header information for the table ...

    Gregg

  5. #5
    Join Date
    Jan 2004
    Location
    Singapore
    Posts
    89
    Quote Originally Posted by gbrabham
    I believe that you will also incur the added expense of an additional byte
    per row per column over 250 bytes ..... This is part of Oracle's header information for the table ...

    Gregg
    Thanks for the information Mr. Gregg
    Thanks and Regards,

    Praveen Pulikunnu

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •