Unix Technical Forum

Number(30)

This is a discussion on Number(30) within the Oracle Miscellaneous forums, part of the Oracle Database category; --> hi, we currently have a column in our table (oracle 9i) defined as number(30). however, when we try to ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 12:41 PM
val
 
Posts: n/a
Default Number(30)

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!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 12:41 PM
romeo.olympia@gmail.com
 
Posts: n/a
Default Re: Number(30)

On May 3, 2:30 pm, val <minnie_ngu...@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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-08-2008, 12:41 PM
Mark D Powell
 
Posts: n/a
Default Re: Number(30)

On May 3, 3:05 am, romeo.olym...@gmail.com wrote:
> On May 3, 2:30 pm, val <minnie_ngu...@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 --

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:23 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com