Home » SQL & PL/SQL » SQL & PL/SQL » number datatype
number datatype [message #232929] Tue, 24 April 2007 02:21 Go to next message
shivakumarag
Messages: 6
Registered: April 2007
Location: india
Junior Member
hi
what is the best way to keep the number datatype in table column data_rep
where i will be storing data 1234567891.99 here it should not merge .99 to 1 eg:1234567891.29 to 1234567891.3
is it
number(10,2) or (12,2) or number itself or smothing else
thanxs
Re: number datatype [message #232934 is a reply to message #232929] Tue, 24 April 2007 02:36 Go to previous messageGo to next message
Michel Cadot
Messages: 64153
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> create table t (c1 number(10,2));

Table created.

SQL> insert into t values (1234567891.99);
insert into t values (1234567891.99)
                      *
ERROR at line 1:
ORA-01438: value larger than specified precision allowed for this column


SQL> drop table t;

Table dropped.

SQL> create table t (c1 number(12,2));

Table created.

SQL> insert into t values (1234567891.99);

1 row created.

SQL> select * from t;
                  C1
--------------------
       1234567891.99

1 row selected.

Have a look at NUMBER Datatype section in SQL Reference.

Regards
Michel
Re: number datatype [message #232938 is a reply to message #232934] Tue, 24 April 2007 02:42 Go to previous message
shivakumarag
Messages: 6
Registered: April 2007
Location: india
Junior Member

thanx for speedy answer
Previous Topic: multiple update statements
Next Topic: Grant Privileges on schema
Goto Forum:
  


Current Time: Sun Dec 11 07:54:10 CST 2016

Total time taken to generate the page: 0.19497 seconds