Solved

Default size of number datatype

Posted on 2001-06-21
5
12,766 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

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…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

762 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now