Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2003
    Posts
    11

    Unanswered: Want to know size in bytes taken by each dataType Oracle supports.

    Hello ,

    I would like to know the size in bytes required internally for each datatype Oracle supports.

    Would like to know the size in bytes for
    NUMBER, VARCHAR, LONG RAW, DATE, DECIMAL

    Thanks..

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Want to know size in bytes taken by each dataType Oracle supports.

    Use the VSIZE function:
    PHP Code:
    SQLselect salvsize(salfrom emp;

           
    SAL VSIZE(SAL)
    ---------- ----------
           
    800          2
          1600          2
          1250          3
          2975          3
          1250          3
          2850          3
          2450          3
          3000          2
          5000          2
          1500          2
          1100          2
           950          3
          3000          2
          1300          2 

  3. #3
    Join Date
    Jul 2003
    Posts
    11

    Re: Want to know size in bytes taken by each dataType Oracle supports.

    Thanks,

    Does Vsize(..) function return the actual bytes used for storage internally by oracle.

    For eg. for column 'id' of type 'NUMBER', for following values, vsize(..) returns variable result.
    Does this mean that NUMBER type data is also stored internally as per the actual size like varchar
    or there will be some fix storage area assigned for NUMBER internally.



    ID VSIZE(ID)
    22 2
    222 3
    2222 3
    22222 4
    2222222 5


    Originally posted by andrewst
    Use the VSIZE function:
    PHP Code:
    SQLselect salvsize(salfrom emp;

           
    SAL VSIZE(SAL)
    ---------- ----------
           
    800          2
          1600          2
          1250          3
          2975          3
          1250          3
          2850          3
          2450          3
          3000          2
          5000          2
          1500          2
          1100          2
           950          3
          3000          2
          1300          2 

  4. #4
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Want to know size in bytes taken by each dataType Oracle supports.

    Yes, Oracle uses less bytes for small NUMBERs than it does for large ones.

Posting Permissions

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