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: dataman <dataman_at_mail.ev1.net>
Date: Tue, 12 Sep 2006 14:01:47 -0000
Message-id: <4506bda8.660.41@news2>


>
> 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
>

Thanks for the replies. I was reviewing the documentation later and I saw that Decimal is really Number. Damn modeling tools showing me different datatypes that are really the same thing. Received on Tue Sep 12 2006 - 09:01:47 CDT

Original text of this message

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