Scientific counting display problem for long number type numbers in Oracle

Source: Internet
Author: User

There is an ID column in the table with type number (38). When querying in Sqlplus, the query results are displayed in scientific notation:

        ID----------4.5572e+184.5574e+184.5585e+18

This does not seem intuitive, and the reason for this is that under Sql*plus, the accuracy of less than or equal to 10 digits is displayed in a very straightforward form, and the more than 10-bit precision is shown in the form of scientific notation.

The following is the test content:

Sql> select * from V$version; BANNER--------------------------------------------------------------------------------Oracle Database 11g Enterprise Edition release 11.2.0.4.0-64bit productionpl/sql release 11.2.0.4.0-productioncore    11.2.0.4.0      Productiontns for linux:version 11.2.0.4.0-productionnlsrtl Version 11.2.0.4.0-productionsql> CREATE TABLE test (ID Number (20)); sql> INSERT into test values (123456789); sql> INSERT into test values (1234567890); sql> INSERT into test values (12345678901); Sql> commit; Commit complete. Sql> select ID from test;        ID----------12345678912345678901.2346e+10sql> Select ID from test where id=1234567890;        ID----------1234567890sql> Select ID from test where id=12345678901;        ID----------1.2346e+10sql>

Avoid methods that are displayed using scientific notation:

1. Using Set Numwidth

sql> set numwidth 11sql> select ID from test where id=12345678901;         

  

2. Turn number to char type

  

Toad and PL/SQL developer also have this display problem, by default the Numwidth settings for both tools are 15, but also give us some of the same, can be done by the following methods:
->view->option->data->display large number in scientific notation in toad, this option is not selected
->tools->preferences->sql windows->number fields ToChar in PL/SQL developer, select this option

Scientific counting display problem for long number type numbers in Oracle

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.