Solved

Default size of number datatype

Posted on 2001-06-21
5
13,400 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

690 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