Check this fun with numeric datatypes
Create table num_test
(
c1 number,
c2 numeric,
c3 decimal,
c4 integer,
c5 smallint,
c6 number(9),
c7 numeric(9),
c8 decimal(9),
c9 number(9,2),
c10 numeric(9,2),
c11 decimal(9,2),
c12 number(*,2),
c13 numeric(*,2),
c14 decimal(*,2),
c15 float,
c16 float(30),
c17 real,
c18 double precision);
Now lets try this
SQL> alter table num_test add c19 number(*);
Table altered.
Elapsed: 00:00:00.16
SQL> alter table num_test add c20 number(*,10);
Table altered.
Elapsed: 00:00:00.02
SQL> alter table num_test add c21 number(10,*);
alter table num_test add c21 number(10,*) *
ERROR at line 1:ORA-01728: numeric scale specifier is out of range (-84 to 127)
SQL> desc num_test
Name Null? Type
--------------------------------------------------- -------- -------------------------------
C1 NUMBER
C2 NUMBER(38)
C3 NUMBER(38)
C4 NUMBER(38)
C5 NUMBER(38)
C6 NUMBER(9)
C7 NUMBER(9)
C8 NUMBER(9)
C9 NUMBER(9,2)
C10 NUMBER(9,2)
C11 NUMBER(9,2)
C12 NUMBER(38,2)
C13 NUMBER(38,2)
C14 NUMBER(38,2)
C15 FLOAT(126)
C16 FLOAT(30)
C17 FLOAT(63)
C18 FLOAT(126)
C19 NUMBER
C20 NUMBER(38,10)
Note that the length of NUMBER datatype is 126 max. (ie) It can store upto 126 digits as its maximum.
Saturday, June 6, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment