Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Number or Decimal?

Re: Number or Decimal?

From: Vladimir M. Zakharychev <vladimir.zakharychev_at_gmail.com>
Date: 12 Sep 2006 03:34:38 -0700
Message-ID: <1158057278.557284.315930@p79g2000cwp.googlegroups.com>

Brian Peasland wrote:
> dataman wrote:
> > Which is more efficient?
>
> Please define "efficient"?
>
> Also, be advised, Oracle only has the NUMBER decimal type for storing
> numeric values in the database. There is no DECIMAL datatype.
>
>
> HTH,
>
> Brian
>
>
> --
> ===================================================================
>
> Brian Peasland
> dba_at_nospam.peasland.net
> http://www.peasland.net
>

There is DECIMAL datatype:

SQL> select banner from v$version;

BANNER



Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Prod PL/SQL Release 10.2.0.2.0 - Production
CORE 10.2.0.2.0 Production
TNS for 32-bit Windows: Version 10.2.0.2.0 - Production NLSRTL Version 10.2.0.2.0 - Production

SQL> declare
  2 x decimal;
  3 begin
  4 x := 12345678;
  5 end;
  6 /

PL/SQL procedure successfully completed.

SQL> create table test (x decimal);

Table created.

However, this doesn't change anything as DECIMAL(p,s) is actually NUMBER(p,0) (scale can't be non-zero.) So the answer to the OP's question is: there's no difference between the two except that DECIMAL's scale is constrained to 0. See the SQL Reference, paragraph named "ANSI, DB2 and SQL/DS Datatypes" for more information about supported non-Oracle datatypes and their mappings to Oracle datatypes.

Regards,

    Vladimir M. Zakharychev
    N-Networks, makers of Dynamic PSP(tm)     http://www.dynamicpsp.com Received on Tue Sep 12 2006 - 05:34:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US