Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2003
    Location
    Singapore
    Posts
    200

    Unanswered: Size of Data type

    Hi,

    I need to clarify something abt data types.

    WHat is the max size from Char,Varchar,varchar2,Clob,Lob,Number.

    another thing is when i specify Number (4)-is it 4 bites or 4 bytes.Does this mean i can only enter till 9999.

    Now if i have a table with 2 fields -id number (4) and Name varchar(10),and i have 10 rows in the table how can i find the size of the table in bytes.

    Appreciate any help.

    THanks

    mickykt

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

    Re: Size of Data type

    Originally posted by mickykt
    Hi,

    I need to clarify something abt data types.

    WHat is the max size from Char,Varchar,varchar2,Clob,Lob,Number.

    another thing is when i specify Number (4)-is it 4 bites or 4 bytes.Does this mean i can only enter till 9999.

    Now if i have a table with 2 fields -id number (4) and Name varchar(10),and i have 10 rows in the table how can i find the size of the table in bytes.

    Appreciate any help.

    THanks

    mickykt
    Suggest you consult the manual:

    http://technet.oracle.com/docs/produ...ts2a.htm#45443

    NUMBER(4) means a 4-digit integer, so 9999 is maximum value allowed, yes.

    A table as small as your example (10 rows and 2 columns) will have all its data in a single block (usually 4K or 8K bytes). However, the table will likely be bigger than that because an initial storage allocation is made when the table is created. It's not as simple as (10 * (4+10)) or anything like that.

    If you are interested in knowing more, look here:

    http://technet.oracle.com/docs/produ...chem.htm#31717

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

    Re: Size of Data type

    Further to that, to get the current size of the table in bytes:

    SELECT bytes FROM user_segments WHERE segment_name='MYTABLE';

Posting Permissions

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