Format the output of numeric scientific notation(12E+10) in sqlplus

In sqlplus commandline, we dont get proper output on the screen for large number because of width and column number format rather we get scientific notation which is absurd in case of dbid or scn number of a database.

There are two ways to get proper output with full digits

One variable is numwidth

kish@exdbx<>select 10000000000*9 from dual;

10000000000*9
-------------
   9.0000E+10

Elapsed: 00:00:00.00
kish@exdbx<>set numwidth 25
kish@exdbx<>select 10000000000*9 from dual;

            10000000000*9
-------------------------
              90000000000

Another variable is col column_name format 99999….

kish@exdbx<>select 10000000000*3 from dual;

10000000000*3
-------------
   3.0000E+10

Elapsed: 00:00:00.01
kish@exdbx<>col 10000000000*3 format 99999999999
kish@exdbx<>select 10000000000*3 from dual;

10000000000*3
-------------
  30000000000

Elapsed: 00:00:00.02

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s