Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

What is the point of Precision and Scale in Number Type?

CastellJan 3 2013 — edited Jan 3 2013
Version :11.2

What is the point in having PRECISION and SCALE in number type? If you create the column with just NUMBER ie.without
specifying precision or scale , you can enter numbers with any precision and scale.


SQL> select * From v$version where rownum < 2;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production


SQL> create table t1 (col1 number);

Table created.

SQL> insert into t1 values (223.9939394);

1 row created.

SQL> insert into t1 values (88.228384);

1 row created.

SQL> insert into t1 values (9.34);

1 row created.

SQL> insert into t1 values (000.00);

1 row created.

SQL> commit;

Commit complete.

SQL> select * from t1;

      COL1
----------
223.993939
 88.228384
      9.34
         0
Did you ever have a business scenario where a Numerical column should store values only with a fixed precision and scale ?
This post has been answered by BluShadow on Jan 3 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 31 2013
Added on Jan 3 2013
2 comments
858 views