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(30)

Re: Number(30)

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 3 May 2007 05:38:06 -0700
Message-ID: <1178195886.762286.17840@l77g2000hsb.googlegroups.com>


On May 3, 3:05 am, romeo.olym..._at_gmail.com wrote:
> On May 3, 2:30 pm, val <minnie_ngu..._at_yahoo.com> wrote:
>
> > hi,
> > we currently have a column in our table (oracle 9i) defined as
> > number(30). however, when we try to insert data that has 25 digits,
> > it stores the number as 1.7909364352007E23. can you let me know why
> > it has exponents versus loading the number as is with 25 digits? how
> > can i change the datatype to store 25 digits. varchar(30)?
>
> > thanks!
>
> number(30) would store that long number properly. It's probably a
> display issue.
>
> Are you using sqlplus to submit your select query? Try the COL command
> to set the display format and length.
>
> Cheers,
>
> Romeo

Romeo is correct in that this is a display issue. UT1 > create table holdnumber (fld1 number(30));

Table created.

UT1 >
UT1 > insert into holdnumber values (1234567890123456789012345);

1 row created.

UT1 >
UT1 > select * from holdnumber;

      FLD1



1.2346E+24

UT1 > set numwidth 30
UT1 > select * from holdnumber;

                          FLD1
------------------------------
     1234567890123456789012345

UT1 >
UT1 > drop table holdnumber;

Table dropped.

Val, look up the SET command in your SQLPlus manual. The options this command provides are very useful for formatting queries and reports via SQLPlus.

HTH -- Mark D Powell -- Received on Thu May 03 2007 - 07:38:06 CDT

Original text of this message

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