Home » SQL & PL/SQL » SQL & PL/SQL » Change Precisssion
Change Precisssion [message #270824] Fri, 28 September 2007 01:52 Go to next message
ram_ocp
Messages: 49
Registered: December 2005
Location: Karnataka
Member
Hi,
I have a small doubt can you help

The data in a column have values like
-2021978521
-2021424827
-2021130886
The difference between two values are very less.
But when i take the ouput of the column.I get like
-2.021E+09
-2.021E+09
As a result i am not able to select distinct values.
Can you let me know how to change the output precission to
-2021978521 from -2.013E+09 in simple select statement

Thanks
Ram
Re: Change Precisssion [message #270827 is a reply to message #270824] Fri, 28 September 2007 01:56 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
You have a data presentation problem NOT a data storage problem.
SQL> column DATA_VALUE format 999999999999999999999
Re: Change Precisssion [message #270833 is a reply to message #270824] Fri, 28 September 2007 02:24 Go to previous messageGo to next message
ram_ocp
Messages: 49
Registered: December 2005
Location: Karnataka
Member
Tried the above command but still gives result in exponential form
Re: Change Precisssion [message #270840 is a reply to message #270833] Fri, 28 September 2007 02:37 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Does it?
SQL> create table test (data_value number);

Table created.

SQL> insert into test values (-2021978521);

1 row created.

SQL> select * From test;

DATA_VALUE
----------
-2.022E+09

SQL> column data_value format 99999999999999999999
SQL> select * From test;

           DATA_VALUE
---------------------
          -2021978521

SQL>

Copy-paste your SQL*Plus session so that we could see it.
Re: Change Precisssion [message #270842 is a reply to message #270833] Fri, 28 September 2007 02:42 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
ram_ocp wrote on Fri, 28 September 2007 09:24
Tried the above command but still gives result in exponential form

replace DATA_VALUE with your column name (or the alias you use in the query)
Re: Change Precisssion [message #270866 is a reply to message #270824] Fri, 28 September 2007 03:52 Go to previous messageGo to next message
ram_ocp
Messages: 49
Registered: December 2005
Location: Karnataka
Member
SQL> column mxid format 999999999999999999999
SQL> select distinct mxid from mxattr ;

MXID
----------
-2.009E+09
-2.009E+09
-2.009E+09

Re: Change Precisssion [message #270869 is a reply to message #270866] Fri, 28 September 2007 03:57 Go to previous messageGo to next message
Michel Cadot
Messages: 68722
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
desc mxattr

Please read and follow OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format. Use the "Preview Message" button.

Regards
Michel
Re: Change Precisssion [message #270874 is a reply to message #270869] Fri, 28 September 2007 04:07 Go to previous messageGo to next message
ram_ocp
Messages: 49
Registered: December 2005
Location: Karnataka
Member
Thanks here is the formatted output

SQL> desc  mxattrtype ;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------

 MXNAME                                             VARCHAR2(128)
 MXID                                      NOT NULL NUMBER(38)
 MXFLAGS                                            NUMBER(38)
 MXPARENT                                           NUMBER(38)
 MXTYPE                                             NUMBER(38)
 MXDEFAULT                                          VARCHAR2(255)

[Updated on: Fri, 28 September 2007 04:17]

Report message to a moderator

Re: Change Precisssion [message #270876 is a reply to message #270874] Fri, 28 September 2007 04:10 Go to previous message
Michel Cadot
Messages: 68722
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
Is there any other alternative ?

To format? yes, read the guide.

Regards
Michel
Previous Topic: Select Query with date comparison
Next Topic: Regarding mutating error on a table
Goto Forum:
  


Current Time: Tue Dec 10 02:07:34 CST 2024