?
Solved

Default size of number datatype

Posted on 2001-06-21
5
Medium Priority
?
13,564 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 200 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

Introducing Priority Question

Increase expert visibility of your issues by participating in Priority Question, our latest feature for Premium and Team Account holders. Adjust the priority of your question to get emergent issues in front of subject-matter experts for help when you need it most.

Question has a verified solution.

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

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

741 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