Results 1 to 4 of 4

Thread: simple question

  1. #1
    Join Date
    Sep 2003
    Posts
    218

    Unanswered: simple question

    env: Oracle9i on solaris8

    I have a table x (c1 number) and inserted a value "31641433495". When I try to select c1 from x, I get a "3.1641E+10" (exponential) value instead of a extact number that got inserted at first.

    I tried changing the datatype to Double/Float etc, however, result is the same.

    Thanks in advance.

  2. #2
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    It's just the way that sql*plus displayes large numbers, it is still stored correctly in the database. If you want to display the number use to_char or format the column. See below for examples

    SQL> create table x (c1 number);

    Table created.

    SQL> insert into x values(31641433495);

    1 row created.

    SQL> select c1 from x;

    C1
    ---------
    3.164E+10

    SQL> select to_char(c1) from x;

    TO_CHAR(C1)
    ----------------------------------------
    31641433495

    SQL> column c1 format 99999999999
    SQL> select c1 from x;

    C1
    ------------
    31641433495

    SQL> drop table x;

    Table dropped.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  3. #3
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    I believe you could also

    sql> set numwidth 18
    sql> select c1 from x;

    HTH
    Gregg

  4. #4
    Join Date
    Sep 2003
    Posts
    218
    many thanx... to beilstwh, gbrabham. This is what I was looking for!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •