Solved

Default size of number datatype

Posted on 2001-06-21
5
13,187 Views
Last Modified: 2011-09-20
I would like to know what is the default size of number
datatype in Oracle  if the size is not specified while creating the table .

Eg:
Create table emp
(empno number,
name varchar(20));

Thanks
0
Comment
Question by:sumans1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 3

Expert Comment

by:myerpz
ID: 6214873
The default size is 38
0
 

Accepted Solution

by:
davidgornshtein earned 50 total points
ID: 6214927

Hi,
 If you are not defining restrictions on number
 size, you can insert every number within oracle
 internal definitons restrictions.

 It's from the oracle manual about system defined  
 restrictions:

 The NUMBER datatype stores zero,
 positive, and negative fixed and
 floating-point numbers with magnitudes
 between 1.0 x 10 -130 and 9.9...9 x 10 125
 (38 nines followed by 88 zeroes)
 with 38 digits of precision.

 This means, that you can store every number.

 However, you should understand, that precision and
 scale in NUMBER(precision ,scale) is restrictions
 on number.

 Look at internal representation of number:

 Number defined in oracle as variable length sequence
 where first byte is exponent + sign (msb) and
 all other bytes are mantissa represented in excess 100
 and last byte is 0x66 for negatives.

example:
  02 c1 33   - this means 2 -length, c1 - 128 - 65 =0
               0x33 = 51  
  (51 - 1) * 100^0 = 50

Regards.

 
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7063422
Hi sumans1,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. If there is no objection or further activity, I will suggest to:

    Accept davidgornshtein's answer.

sumans1, if you think your question was not answered at all, you can post a new comment here.  Community Support moderators will followup.

Please do not accept this comment as an answer!

EXPERTS: Your input and closing recommendations are REQUESTED.
==========
sumans1 -- EE database cleanup volunteer
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7082977
Recommended disposition:

    Accept davidgornshtein's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7090508
Thanks for your help here, Dan.
Finalized.
Moondancer - EE Moderator
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Create file system directory from Oracle 10g 4 33
Fill Null values 5 37
join a table with user_tab_columns in oracle 3 69
Updating a temp table inside a PL/SQL block 3 51
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
This video shows how to recover a database from a user managed backup
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question